Python股票數(shù)據(jù)可視化代碼詳解
import numpy as np import pandas as pd from pandas_datareader import data import datetime as dt
數(shù)據(jù)準備
''' 獲取國內(nèi)股票數(shù)據(jù)的方式是:“股票代碼”+“對應(yīng)股市”(港股為.hk,A股為.ss) 例如騰訊是港股是:0700.hk ''' #字典:6家公司的股票 # gafataDict={'谷歌':'GOOG','亞馬遜':'AMZN','Facebook':'FB', '蘋果':'AAPL','阿里巴巴':'BABA','騰訊':'0700.hk'}
''' 定義函數(shù) 函數(shù)功能:計算股票漲跌幅=(現(xiàn)在股價-買入價格)/買入價格 輸入?yún)?shù):column是收盤價這一列的數(shù)據(jù) 返回數(shù)據(jù):漲跌幅 ''' def change(column): # 買入價格 buyPrice=column[0] # 現(xiàn)在股價 curPrice=column[column.size-1] priceChange=(curPrice-buyPrice)/buyPrice # 判斷股票是上漲還是下跌 if priceChange>0: print('股票累計上漲=',round(priceChange*100,2),'%') elif priceChange==0: print('股票無變化=',round(priceChange*100,2)*100,'%') else: print('股票累計下跌=',round(priceChange*100,2)*100,'%') # 返回數(shù)據(jù) return priceChange
''' 三星電子 每日股票價位信息 Open:開盤價 High:最高加 Low:最低價 Close:收盤價 Volume:成交量 因雅虎連接不到,僅以三星作為獲取數(shù)據(jù)示例 ''' sxDf = data.DataReader('005930', 'naver', start='2021-01-01', end='2022-01-01') sxDf.head()
Open | High | Low | Close | Volume | |
---|---|---|---|---|---|
Date | |||||
2021-01-04 | 81000 | 84400 | 80200 | 83000 | 38655276 |
2021-01-05 | 81600 | 83900 | 81600 | 83900 | 35335669 |
2021-01-06 | 83300 | 84500 | 82100 | 82200 | 42089013 |
2021-01-07 | 82800 | 84200 | 82700 | 82900 | 32644642 |
2021-01-08 | 83300 | 90000 | 83000 | 88800 | 59013307 |
sxDf.info()
<class 'pandas.core.frame.DataFrame'> DatetimeIndex: 248 entries, 2021-01-04 to 2021-12-30 Data columns (total 5 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Open 248 non-null object 1 High 248 non-null object 2 Low 248 non-null object 3 Close 248 non-null object 4 Volume 248 non-null object dtypes: object(5) memory usage: 11.6+ KB
sxDf.iloc[:,0:4]=sxDf.iloc[:,0:4].astype('float') sxDf.iloc[:,-1]=sxDf.iloc[:,-1].astype('int') sxDf.info()
<class 'pandas.core.frame.DataFrame'>DatetimeIndex: 248 entries, 2021-01-04 to 2021-12-30Data columns (total 5 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Open 248 non-null float64 1 High 248 non-null float64 2 Low 248 non-null float64 3 Close 248 non-null float64 4 Volume 248 non-null int32 dtypes: float64(4), int32(1)memory usage: 10.7 KB<class 'pandas.core.frame.DataFrame'> DatetimeIndex: 248 entries, 2021-01-04 to 2021-12-30 Data columns (total 5 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Open 248 non-null float64 1 High 248 non-null float64 2 Low 248 non-null float64 3 Close 248 non-null float64 4 Volume 248 non-null int32 dtypes: float64(4), int32(1) memory usage: 10.7 KB
阿里巴巴
# 讀取數(shù)據(jù) AliDf=pd.read_excel(r'C:\Users\EDY\Desktop\吧哩吧啦\學(xué)習\Untitled Folder\阿里巴巴2017年股票數(shù)據(jù).xlsx',index_col='Date') AliDf.tail()
Open | High | Low | Close | Adj Close | Volume | |
---|---|---|---|---|---|---|
Date | ||||||
2017-12-22 | 175.839996 | 176.660004 | 175.039993 | 176.289993 | 176.289993 | 12524700 |
2017-12-26 | 174.550003 | 175.149994 | 171.729996 | 172.330002 | 172.330002 | 12913800 |
2017-12-27 | 172.289993 | 173.869995 | 171.729996 | 172.970001 | 172.970001 | 10152300 |
2017-12-28 | 173.039993 | 173.529999 | 171.669998 | 172.300003 | 172.300003 | 9508100 |
2017-12-29 | 172.279999 | 173.669998 | 171.199997 | 172.429993 | 172.429993 | 9704600 |
# 查看基本信息及數(shù)據(jù)類型 AliDf.info()
<class 'pandas.core.frame.DataFrame'> DatetimeIndex: 251 entries, 2017-01-03 to 2017-12-29 Data columns (total 6 columns): # Column Non-Null Count Dtype --- ------ -------------- ----- 0 Open 251 non-null float64 1 High 251 non-null float64 2 Low 251 non-null float64 3 Close 251 non-null float64 4 Adj Close 251 non-null float64 5 Volume 251 non-null int64 dtypes: float64(5), int64(1) memory usage: 13.7 KB
# 計算漲跌幅 AliChange=change(AliDf['Close'])
股票累計上漲= 94.62 %
'''增加一列累計增長百分比''' #一開始的股價 Close1=AliDf['Close'][0] # # .apply(lambda x: format(x, '.2%')) AliDf['sum_pct_change']=AliDf['Close'].apply(lambda x: (x-Close1)/Close1) AliDf['sum_pct_change'].tail()
Date 2017-12-22 0.989729 2017-12-26 0.945034 2017-12-27 0.952257 2017-12-28 0.944695 2017-12-29 0.946162 Name: sum_pct_change, dtype: float64
谷歌
# 讀取數(shù)據(jù) GoogleDf=pd.read_excel(r'C:\Users\EDY\Desktop\吧哩吧啦\學(xué)習\Untitled Folder\谷歌2017年股票數(shù)據(jù).xlsx',index_col='Date') GoogleDf.tail()
Open | High | Low | Close | Adj Close | Volume | |
---|---|---|---|---|---|---|
Date | ||||||
2017-12-22 | 1061.109985 | 1064.199951 | 1059.439941 | 1060.119995 | 1060.119995 | 755100 |
2017-12-26 | 1058.069946 | 1060.119995 | 1050.199951 | 1056.739990 | 1056.739990 | 760600 |
2017-12-27 | 1057.390015 | 1058.369995 | 1048.050049 | 1049.369995 | 1049.369995 | 1271900 |
2017-12-28 | 1051.599976 | 1054.750000 | 1044.770020 | 1048.140015 | 1048.140015 | 837100 |
2017-12-29 | 1046.719971 | 1049.699951 | 1044.900024 | 1046.400024 | 1046.400024 | 887500 |
# 計算漲跌幅 GoogleChange=change(GoogleDf['Close'])
股票累計上漲= 33.11 %
'''增加一列累計增長百分比''' #一開始的股價 Close1=GoogleDf['Close'][0] # # .apply(lambda x: format(x, '.2%')) GoogleDf['sum_pct_change']=GoogleDf['Close'].apply(lambda x: (x-Close1)/Close1) GoogleDf['sum_pct_change'].tail()
Date 2017-12-22 0.348513 2017-12-26 0.344213 2017-12-27 0.334839 2017-12-28 0.333274 2017-12-29 0.331061 Name: sum_pct_change, dtype: float64
蘋果
# 讀取數(shù)據(jù) AppleDf=pd.read_excel(r'C:\Users\EDY\Desktop\吧哩吧啦\學(xué)習\Untitled Folder\蘋果2017年股票數(shù)據(jù).xlsx',index_col='Date') AppleDf.tail()
Open | High | Low | Close | Adj Close | Volume | |
---|---|---|---|---|---|---|
Date | ||||||
2017-12-22 | 174.679993 | 175.419998 | 174.500000 | 175.009995 | 174.299362 | 16349400 |
2017-12-26 | 170.800003 | 171.470001 | 169.679993 | 170.570007 | 169.877396 | 33185500 |
2017-12-27 | 170.100006 | 170.779999 | 169.710007 | 170.600006 | 169.907272 | 21498200 |
2017-12-28 | 171.000000 | 171.850006 | 170.479996 | 171.080002 | 170.385315 | 16480200 |
2017-12-29 | 170.520004 | 170.589996 | 169.220001 | 169.229996 | 168.542831 | 25999900 |
# 計算漲跌幅 AppleChange=change(AppleDf['Close'])
股票累計上漲= 45.7 %
'''增加一列累計增長百分比''' #一開始的股價 Close1=AppleDf['Close'][0] # # .apply(lambda x: format(x, '.2%')) AppleDf['sum_pct_change']=AppleDf['Close'].apply(lambda x: (x-Close1)/Close1) AppleDf['sum_pct_change'].tail()
Date 2017-12-22 0.506758 2017-12-26 0.468532 2017-12-27 0.468790 2017-12-28 0.472923 2017-12-29 0.456995 Name: sum_pct_change, dtype: float64
騰訊
# 讀取數(shù)據(jù) TencentDf=pd.read_excel(r'C:\Users\EDY\Desktop\吧哩吧啦\學(xué)習\Untitled Folder\騰訊2017年股票數(shù)據(jù).xlsx',index_col='Date') TencentDf.tail()
Open | High | Low | Close | Adj Close | Volume | |
---|---|---|---|---|---|---|
Date | ||||||
2017-12-22 | 403.799988 | 405.799988 | 400.799988 | 405.799988 | 405.799988 | 16146080 |
2017-12-27 | 405.799988 | 407.799988 | 401.000000 | 401.200012 | 401.200012 | 16680601 |
2017-12-28 | 404.000000 | 408.200012 | 402.200012 | 408.200012 | 408.200012 | 11662053 |
2017-12-29 | 408.000000 | 408.000000 | 403.399994 | 406.000000 | 406.000000 | 16601658 |
2018-01-02 | 406.000000 | 406.000000 | 406.000000 | 406.000000 | 406.000000 | 0 |
# 讀取數(shù)據(jù) TencentDf=pd.read_excel(r'C:\Users\EDY\Desktop\吧哩吧啦\學(xué)習\Untitled Folder\騰訊2017年股票數(shù)據(jù).xlsx',index_col='Date') TencentDf.tail()
Open | High | Low | Close | Adj Close | Volume | |
---|---|---|---|---|---|---|
Date | ||||||
2017-12-22 | 403.799988 | 405.799988 | 400.799988 | 405.799988 | 405.799988 | 16146080 |
2017-12-27 | 405.799988 | 407.799988 | 401.000000 | 401.200012 | 401.200012 | 16680601 |
2017-12-28 | 404.000000 | 408.200012 | 402.200012 | 408.200012 | 408.200012 | 11662053 |
2017-12-29 | 408.000000 | 408.000000 | 403.399994 | 406.000000 | 406.000000 | 16601658 |
2018-01-02 | 406.000000 | 406.000000 | 406.000000 | 406.000000 | 406.000000 | 0 |
# 計算漲跌幅 TencentChange=change(TencentDf['Close'])
股票累計上漲= 114.36 %
'''增加一列累計增長百分比''' #一開始的股價 Close1=TencentDf['Close'][0] # # .apply(lambda x: format(x, '.2%')) TencentDf['sum_pct_change']=TencentDf['Close'].apply(lambda x: (x-Close1)/Close1) TencentDf['sum_pct_change'].tail()
Date 2017-12-22 1.142555 2017-12-27 1.118268 2017-12-28 1.155227 2017-12-29 1.143611 2018-01-02 1.143611 Name: sum_pct_change, dtype: float64
亞馬遜
# 讀取數(shù)據(jù) AmazonDf=pd.read_excel(r'C:\Users\EDY\Desktop\吧哩吧啦\學(xué)習\Untitled Folder\亞馬遜2017年股票數(shù)據(jù).xlsx',index_col='Date') AmazonDf.tail()
Open | High | Low | Close | Adj Close | Volume | |
---|---|---|---|---|---|---|
Date | ||||||
2017-12-22 | 1172.079956 | 1174.619995 | 1167.829956 | 1168.359985 | 1168.359985 | 1585100 |
2017-12-26 | 1168.359985 | 1178.319946 | 1160.550049 | 1176.760010 | 1176.760010 | 2005200 |
2017-12-27 | 1179.910034 | 1187.290039 | 1175.609985 | 1182.260010 | 1182.260010 | 1867200 |
2017-12-28 | 1189.000000 | 1190.099976 | 1184.380005 | 1186.099976 | 1186.099976 | 1841700 |
2017-12-29 | 1182.349976 | 1184.000000 | 1167.500000 | 1169.469971 | 1169.469971 | 2688400 |
# 計算漲跌幅 AmazonChange=change(AmazonDf['Close'])
股票累計上漲= 55.17 %
'''增加一列累計增長百分比''' #一開始的股價 Close1=AmazonDf['Close'][0] # # .apply(lambda x: format(x, '.2%')) AmazonDf['sum_pct_change']=AmazonDf['Close'].apply(lambda x: (x-Close1)/Close1) AmazonDf['sum_pct_change'].tail()
Date 2017-12-22 0.550228 2017-12-26 0.561373 2017-12-27 0.568671 2017-12-28 0.573766 2017-12-29 0.551700 Name: sum_pct_change, dtype: float64
# 讀取數(shù)據(jù) FacebookDf=pd.read_excel(r'C:\Users\EDY\Desktop\吧哩吧啦\學(xué)習\Untitled Folder\Facebook2017年股票數(shù)據(jù).xlsx',index_col='Date') FacebookDf.tail()
Open | High | Low | Close | Adj Close | Volume | |
---|---|---|---|---|---|---|
Date | ||||||
2017-12-22 | 177.139999 | 177.529999 | 176.229996 | 177.199997 | 177.199997 | 8509500 |
2017-12-26 | 176.630005 | 177.000000 | 174.669998 | 175.990005 | 175.990005 | 8897300 |
2017-12-27 | 176.550003 | 178.440002 | 176.259995 | 177.619995 | 177.619995 | 9496100 |
2017-12-28 | 177.949997 | 178.940002 | 177.679993 | 177.919998 | 177.919998 | 12220800 |
2017-12-29 | 178.000000 | 178.850006 | 176.460007 | 176.460007 | 176.460007 | 10261500 |
# 計算漲跌幅 FacebookChange=change(FacebookDf['Close'])
股票累計上漲= 51.0 %
'''增加一列每日增長百分比''' # .pct_change()返回變化百分比,第一行因沒有可對比的,返回Nan,填充為0 FacebookDf['pct_change']=FacebookDf['Close'].pct_change(1).fillna(0) FacebookDf['pct_change'].head()
Date 2017-01-03 0.000000 2017-01-04 0.015660 2017-01-05 0.016682 2017-01-06 0.022707 2017-01-09 0.012074 Name: pct_change, dtype: float64
'''增加一列累計增長百分比''' #一開始的股價 Close1=FacebookDf['Close'][0] # .apply(lambda x: format(x, '.2%')) FacebookDf['sum_pct_change']=FacebookDf['Close'].apply(lambda x: (x-Close1)/Close1) FacebookDf['sum_pct_change'].tail()
Date 2017-12-22 0.516344 2017-12-26 0.505990 2017-12-27 0.519938 2017-12-28 0.522506 2017-12-29 0.510012 Name: sum_pct_change, dtype: float64
數(shù)據(jù)可視化
import matplotlib.pyplot as plt
# 查看成交量與股價之間的關(guān)系 fig=plt.figure(figsize=(10,5)) AliDf.plot(x='Volume',y='Close',kind='scatter') plt.xlabel('成交量') plt.ylabel('股價') plt.title('成交量與股價之間的關(guān)系') plt.show()
<Figure size 720x360 with 0 Axes>
# 查看各個參數(shù)之間的相關(guān)性,與股價與成交量之間呈中度相關(guān) AliDf.corr()
Open | High | Low | Close | Adj Close | Volume | sum_pct_change | |
---|---|---|---|---|---|---|---|
Open | 1.000000 | 0.999281 | 0.998798 | 0.998226 | 0.998226 | 0.424686 | 0.998226 |
High | 0.999281 | 1.000000 | 0.998782 | 0.999077 | 0.999077 | 0.432467 | 0.999077 |
Low | 0.998798 | 0.998782 | 1.000000 | 0.999249 | 0.999249 | 0.401456 | 0.999249 |
Close | 0.998226 | 0.999077 | 0.999249 | 1.000000 | 1.000000 | 0.415801 | 1.000000 |
Adj Close | 0.998226 | 0.999077 | 0.999249 | 1.000000 | 1.000000 | 0.415801 | 1.000000 |
Volume | 0.424686 | 0.432467 | 0.401456 | 0.415801 | 0.415801 | 1.000000 | 0.415801 |
sum_pct_change | 0.998226 | 0.999077 | 0.999249 | 1.000000 | 1.000000 | 0.415801 | 1.000000 |
查看各個公司的股價平均值
AliDf['Close'].mean()
141.79179260159364
'''數(shù)據(jù)準備''' # 計算每家公司的收盤價平均值 Close_mean={'Alibaba':AliDf['Close'].mean(), 'Google':GoogleDf['Close'].mean(), 'Apple':AppleDf['Close'].mean(), 'Tencent':TencentDf['Close'].mean(), 'Amazon':AmazonDf['Close'].mean(), 'Facebook':FacebookDf['Close'].mean()} CloseMeanSer=pd.Series(Close_mean) CloseMeanSer.sort_values(ascending=False,inplace=True) '''繪制柱狀圖''' # 創(chuàng)建畫板 fig=plt.figure(figsize=(10,5)) # 繪圖 CloseMeanSer.plot(kind='bar') # 設(shè)置x、y軸標簽及標題 plt.xlabel('公司') plt.ylabel('股價平均值(美元)') plt.title('2017年各公司股價平均值') # 設(shè)置y周標簽刻度 plt.yticks(np.arange(0,1100,100)) # 顯示y軸網(wǎng)格 plt.grid(True,axis='y') # 顯示圖像 plt.show()
亞馬遜和谷歌的平均股價很高,遠遠超過其他4家,但是僅看平均值并不能代表什么,下面從分布和走勢方面查看
查看各公司股價分布情況
'''數(shù)據(jù)準備''' # 將6家公司的收盤價整合到一起 CloseCollectDf=pd.concat([AliDf['Close'], GoogleDf['Close'], AppleDf['Close'], TencentDf['Close'], AmazonDf['Close'], FacebookDf['Close']],axis=1) CloseCollectDf.columns=['Alibaba','Google','Apple','Tencent','Amazon','Facebook'] '''繪制箱型圖''' # 創(chuàng)建畫板 fig=plt.figure(figsize=(20,10)) fig.suptitle('2017年各公司股價分布',fontsize=18) # 子圖1 ax1=plt.subplot(121) CloseCollectDf.plot(ax=ax1,kind='box') plt.xlabel('公司') plt.ylabel('股價(美元)') plt.title('2017年各公司股價分布') plt.grid(True,axis='y') # 因谷歌和亞馬遜和兩外四家的差別較大,分開查看, # 子圖2 ax2=plt.subplot(222) CloseCollectDf[['Google','Amazon']].plot(ax=ax2,kind='box') # 設(shè)置x、y軸標簽及標題 plt.ylabel('股價(美元)') plt.title('2017年谷歌和亞馬遜股價分布') # 設(shè)置y周標簽刻度 # plt.yticks(np.arange(0,1300,100)) # 顯示y軸網(wǎng)格 plt.grid(True,axis='y') # 子圖3 ax3=plt.subplot(224) CloseCollectDf[['Alibaba','Apple','Tencent','Facebook']].plot(ax=ax3,kind='box') # 設(shè)置x、y軸標簽及標題 plt.xlabel('公司') plt.ylabel('股價(美元)') plt.title('2017年阿里、蘋果、騰訊、Facebook股價分布') # 設(shè)置y周標簽刻度 # plt.yticks(np.arange(0,1300,100)) # 顯示y軸網(wǎng)格 plt.grid(True,axis='y') plt.subplot # 顯示圖像 plt.show()
從箱型圖看,谷歌和亞馬遜的股價分布較廣,且中位數(shù)偏上,騰訊股價最為集中,波動最小,相對穩(wěn)定。
股價走勢對比
# 創(chuàng)建畫板并設(shè)置大小,constrained_layout=True設(shè)置自動調(diào)整子圖之間間距 fig=plt.figure(figsize=(15,10),constrained_layout=True) # ax=plt.subplots(2,1,sharex=True) fig.suptitle('股價走勢對比',fontsize=18) '''繪制圖像1 ''' ax1=plt.subplot(211) plt.plot(AliDf.index,AliDf['Close'],label='Alibaba') plt.plot(GoogleDf.index,GoogleDf['Close'],label='Google') plt.plot(AppleDf.index,AppleDf['Close'],label='Apple') plt.plot(TencentDf.index,TencentDf['Close'],label='Tencent') plt.plot(AmazonDf.index,AmazonDf['Close'],label='Amazon') plt.plot(FacebookDf.index,FacebookDf['Close'],label='Facebook') # # 設(shè)置xy軸標簽 plt.xlabel('時間') plt.ylabel('股價') # 設(shè)置標題 # plt.title('股價走勢對比') # 圖例顯示位置、大小 plt.legend(loc='upper left',fontsize=12) # 設(shè)置x,y軸間隔,設(shè)置旋轉(zhuǎn)角度,以免重疊 plt.xticks(AliDf.index[::10],rotation=45) plt.yticks(np.arange(0, 1300, step=100)) # 顯示網(wǎng)格 plt.grid(True) '''繪制圖像2''' ax2=plt.subplot(212) plt.plot(AliDf.index,AliDf['sum_pct_change'],label='Alibaba') plt.plot(GoogleDf.index,GoogleDf['sum_pct_change'],label='Google') plt.plot(AppleDf.index,AppleDf['sum_pct_change'],label='Apple') plt.plot(TencentDf.index,TencentDf['sum_pct_change'],label='Tencent') plt.plot(AmazonDf.index,AmazonDf['sum_pct_change'],label='Amazon') plt.plot(FacebookDf.index,FacebookDf['sum_pct_change'],label='Facebook') # 設(shè)置xy軸標簽 plt.xlabel('時間') plt.ylabel('累計增長率') # 設(shè)置標題 # plt.title('股價走勢對比') # 圖例顯示位置、大小 plt.legend(loc='upper left',fontsize=12) # 設(shè)置x,y軸間隔,設(shè)置旋轉(zhuǎn)角度,以免重疊 plt.xticks(AliDf.index[::10],rotation=45) plt.yticks(np.arange(0, 1.2, step=0.1)) # 顯示網(wǎng)格 plt.grid(True) # 調(diào)整子圖間距,subplots_adjust(left=None, bottom=None, right=None, top=None,wspace=None, hspace=None) # 顯示圖像 plt.show()
可以看出,在2017年間,亞馬遜和谷歌的股價雖然偏高,漲幅卻不如阿里巴巴和騰訊。
總結(jié)
觀察以上圖形,可以得出一下結(jié)果:
1、2017年谷歌和亞馬遜股價偏高,波動較大,但其漲幅并不高;
2、2017年阿里巴巴和騰訊的股價平均值相對較小,股價波動比較小,其漲幅卻很高,分別達到了94.62%和114.36%。
本篇文章就到這里了,希望能夠給你帶來幫助,也希望您能夠多多關(guān)注腳本之家的更多內(nèi)容!
相關(guān)文章
python閉包、深淺拷貝、垃圾回收、with語句知識點匯總
在本篇文章里小編給大家整理了關(guān)于python閉包、深淺拷貝、垃圾回收、with語句知識點匯總,有興趣的朋友們學(xué)習下。2020-03-03Python?中如何將十六進制轉(zhuǎn)換為?Base64
本篇文章將介紹在?Python?中將?hex?轉(zhuǎn)換為?base64?的方法,本文結(jié)合實例代碼給大家介紹的非常詳細,需要的朋友可以參考下2023-06-06利用Django-environ如何區(qū)分不同環(huán)境
這篇文章主要給大家介紹了關(guān)于利用Django-environ如何區(qū)分不同環(huán)境的相關(guān)資料,文中通過示例代碼介紹的非常詳細,對大家學(xué)習或者使用django具有一定的參考學(xué)習價值,需要的朋友們下面隨著小編來一起學(xué)習學(xué)習吧2018-08-08Python中Flask-RESTful編寫API接口(小白入門)
這篇文章主要介紹了Python中Flask-RESTful編寫API接口(小白入門),文中通過示例代碼介紹的非常詳細,對大家的學(xué)習或者工作具有一定的參考學(xué)習價值,需要的朋友們下面隨著小編來一起學(xué)習學(xué)習吧2019-12-12Django在urls.py利用函數(shù)path()配置路由時傳遞參數(shù)給調(diào)用的視圖函數(shù)的方法(推薦)
這篇文章主要介紹了Django在urls.py利用函數(shù)path()配置路由時傳遞參數(shù)給調(diào)用的視圖函數(shù)的方法(推薦),本文給大家介紹的非常詳細,對大家的學(xué)習或工作具有一定的參考借鑒價值,需要的朋友參考下吧2024-01-01使用python實現(xiàn)學(xué)生信息管理系統(tǒng)
這篇文章主要為大家詳細介紹了使用python實現(xiàn)學(xué)生信息管理系統(tǒng),文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下2021-02-02