Python庫?Bokeh?數(shù)據(jù)可視化實(shí)用指南
什么是 Bokeh
Bokeh 是 Python 中的交互式可視化庫。Bokeh提供的最佳功能是針對現(xiàn)代 Web 瀏覽器進(jìn)行演示的高度交互式圖形和繪圖。Bokeh 幫助我們制作出優(yōu)雅、簡潔的圖表,其中包含各種圖表。
Bokeh 主要側(cè)重于將數(shù)據(jù)源轉(zhuǎn)換為 JSON 格式,然后用作 BokehJS 的輸入。Bokeh的一些最佳功能是:
- 靈活性: Bokeh 也為復(fù)雜的用例提供簡單的圖表和海關(guān)圖表。
- 功能強(qiáng): Bokeh 具有易于兼容的特性,可以與 Pandas 和 Jupyter 筆記本一起使用。
- 樣式: 我們可以控制圖表,我們可以使用自定義 Javascript 輕松修改圖表。
- 開源: Bokeh 提供了大量的示例和想法,并在 Berkeley Source Distribution (BSD) 許可下分發(fā)。
使用Bokeh,我們可以輕松地將大數(shù)據(jù)可視化并以吸引人的優(yōu)雅方式創(chuàng)建不同的圖表。
在哪使用 Bokeh 圖
有很多可視化庫,為什么我們只需要使用Bokeh?我們可以使用 Bokeh 庫在網(wǎng)頁上嵌入圖表。使用Bokeh,我們可以將圖表嵌入網(wǎng)絡(luò)、制作實(shí)時儀表板和應(yīng)用程序。Bokeh 為圖表提供了自己的樣式選項(xiàng)和小部件。這是使用 Flask 或 Django 在網(wǎng)站上嵌入Bokeh圖的優(yōu)勢。
安裝Bokeh庫
用pip安裝Bokeh庫,運(yùn)行以下命令
pip install pandas-Bokeh
為conda環(huán)境安裝Bokeh庫,運(yùn)行以下命令
conda install -c patrikhlobil pandas-Bokeh
導(dǎo)入Bokeh庫
為Bokeh庫導(dǎo)入必要的包。
import pandas as pd # pip install pandas_Bokeh import pandas_Bokeh from Bokeh.io import show, output_notebook from Bokeh.plotting import figure pandas_Bokeh.output_notebook() pd.set_option('plotting.backend', 'pandas_Bokeh')
Bokeh繪圖是一個用于創(chuàng)建交互式視覺效果的界面,我們從中導(dǎo)入 它作為保存我們圖表的容器。 figure
from Bokeh.plotting import figure
我們需要以下命令來顯示圖表。
from Bokeh.io import show, output_notebook
我們需要以下命令來在 jupyter notebook 中顯示圖表的輸出。
pandas_Bokeh.output_notebook()
要將圖表嵌入為 HTML,請運(yùn)行以下命令。
pandas_bokeh.output_file(文件名)
Hovertool 用于在我們使用鼠標(biāo)指針懸停在數(shù)據(jù)上時顯示值, ColumnDataSource 是 DataFrame 的 Bokeh 版本。
from Bokeh.models import HoverTool, ColumnDataSource
繪制圖表的語法
使用Pandas Bokeh
現(xiàn)在,通過以下代碼將Bokeh繪圖庫用于 Pandas 數(shù)據(jù)框。
dataframe.plot_Bokeh()
為Bokeh創(chuàng)建 Figure 對象
我們將創(chuàng)建一個圖形對象,它只不過是一個保存圖表的容器。我們可以給 figure() 對象取任何名字,這里我們給了 fig.
fig = figure() ''' 自定義繪圖代碼 ''' show(fig)
使用 ColumnDataSource 創(chuàng)建圖表
要將 ColumnDataSource 與渲染函數(shù)一起使用,我們至少需要傳遞 3 個參數(shù):
- x – 包含圖表 x 軸數(shù)據(jù)的 ColumnDataSource 列的名稱
- y – 包含圖表 y 軸數(shù)據(jù)的 ColumnDataSource 列的名稱
- source – ColumnDataSource 列的名稱,該列包含我們?yōu)?x 軸和 y 軸引用的數(shù)據(jù)
要在單獨(dú)的 HTML 文件中顯示輸出圖表,請運(yùn)行以下命令。
output_file('abc.html')
使用Bokeh庫主題
Bokeh主題有一組預(yù)定義的設(shè)計,可以將它們應(yīng)用到您的繪圖中。Bokeh 提供了五個內(nèi)置主題。
- caliber,
- dark_minimal,
- light_minimal,
- night_sky,
- contrast.
下圖顯示了圖表在內(nèi)置主題中的外觀。在這里,我采取了不同主題的折線圖。
運(yùn)行以下代碼以使用內(nèi)置主題繪制圖表。
圖表樣式
為了增強(qiáng)圖表,我們可以使用不同的屬性。對象共有的三組主要屬性:
- 線屬性
- 填充屬性
- 文本屬性
基本造型
我將只添加自定義圖表所需的代碼,您可以根據(jù)需要添加代碼。最后,我將展示帶有演示代碼的圖表,以便清楚地理解。好吧,還有更多屬性的詳細(xì)解釋請參見官方文檔。
為圖表添加背景顏色。
fig = figure(background_fill_color="#fafafa")
設(shè)置圖表寬度和高度的值我們需要在figure()中添加高度和寬度。
fig = figure(height=350, width=500)
隱藏圖表的 x 軸和 y 軸。
fig.axis.visible=False
隱藏圖表的網(wǎng)格顏色。
fig.grid.grid_line_color = None
要更改圖表顏色的強(qiáng)度,我們使用 alpha 。
fig.background_fill_alpha=0.3
要為圖表添加標(biāo)題,我們需要在 figure() 中添加標(biāo)題。
fig = figure(title="abc")
要添加或更改 x 軸和 y 軸標(biāo)簽,請運(yùn)行以下命令。
fig.xaxis.axis_label='X-axis' fig.yaxis.axis_label='Y-axis'
簡單樣式的演示圖表
x = list(range(11)) y0 = x fig = figure(width=500, height=250,title='Title',background_fill_color="#fafafa") fig.circle(x, y0, size=12, color="#53777a", alpha=0.8) fig.grid.grid_line_color = None fig.xaxis.axis_label='X-axis' fig.yaxis.axis_label='Y-axis' show(fig)
使用 Bokeh.plotting 界面創(chuàng)建圖表的步驟是:
- 準(zhǔn)備數(shù)據(jù)
- 創(chuàng)建一個新的情節(jié)
- 為您的數(shù)據(jù)添加渲染,以及您對繪圖的可視化自定義
- 指定生成輸出的位置(在 HTML 文件中或在 Jupyter Notebook 中)
- 顯示結(jié)果
Python 中的 Bokeh用例
數(shù)據(jù)
讓我們加載數(shù)據(jù)并再創(chuàng)建一個特征User ID;用戶 id 會告訴我們它像用戶 1、用戶 2 等哪個用戶。
import glob path = 'archive' all_files = glob.glob(path + "/*.csv") li = [] usr=0 for filename in all_files: usr+=1 df = pd.read_csv(filename, index_col=None, header=0) df['User ID']=usr li.append(df) df = pd.concat(li, axis=0, ignore_index=True) df[:2]
數(shù)據(jù)說明
- Game Completed Date-游戲完成的日期和時間
- Team團(tuán)隊(duì)- 告訴我們玩家是冒名頂替者還是船員
- Outcome結(jié)果- 告訴我們游戲是否贏/輸
- Task Completed已完成的任務(wù) - 船員完成的任務(wù)數(shù)
- All Tasks Completed – 布爾變量顯示所有任務(wù)是否由船員完成
- Murdered謀殺- 船員是否被謀殺
- Imposter Kills冒名頂替者殺死 – 冒名頂替者的擊殺次數(shù)
- Game Length游戲時長——游戲的總持續(xù)時間
- Ejected - 玩家是否被其他玩家驅(qū)逐
- Sabotages Fixed – 船員修復(fù)的破壞次數(shù)
- Time to complete all tasks完成所有任務(wù)的時間——船員完成任務(wù)所用的時間
- Rank Change排名變化- 比賽輸/贏后排名的變化
- Region/Game Code地區(qū)/游戲代碼- 服務(wù)器和游戲代碼
- User ID用戶 ID –用戶數(shù)量。
注意:本文不包含 EDA,但展示了如何在 Bokeh 中使用不同的圖表
看看數(shù)據(jù)的分布。
df.describe(include='O')
我們將創(chuàng)建一個特征 Minute 并從 Game Lenght 中提取數(shù)據(jù)。
df['Min'] = df.apply(lambda x : x['Game Length'].split(" ")[0] , axis = 1) df['Min'] = df['Min'].replace('m', '', regex=True) df['Min'][:2]
0 07 1 16 Name: Min, dtype: object
現(xiàn)在,我們將替換 Murdered 特征的值。
df['Murdered'].replace(['No', 'Yes', '-'], ['Not Murdered', 'Murdered', 'Missing'],inplace=True)
完成必要的清潔步驟后。首先,讓我們看看Bokeh中的基本圖表。
餅形圖
檢查一下游戲中是否有更多的船員或冒名頂替者,我們有總共 2227 人的數(shù)據(jù)。
df_team = df.Team.value_counts() df_team.plot_Bokeh(kind='pie', title='Ration of Mposter vs Crewmate')
如圖所示,Cremates 占 79%
,Imposters 占 21%
,由此可見 Imposter: Crewmates
的比例為1:4
。冒名頂替者較少,因此有可能贏得大部分比賽。
圓環(huán)圖
檢查游戲中是否有更多的船員或冒名頂替者被謀殺。我們將添加兩個我們將在圖表中使用的功能 Angle 和 Color。
from math import pi df_mur = df.Murdered.value_counts().reset_index().rename(columns={'index': 'Murdered', 'Murdered': 'Value'}) df_mur['Angle'] = df_mur['Value']/df_mur['Value'].sum() * 2*pi df_mur['Color'] = ['#3182bd', '#6baed6', '#9ecae1'] df_mur
將用annular_wedge()
做一個圓環(huán)圖。
from Bokeh.transform import cumsum fig = figure(plot_height=350, title="Ration of Murdered vs Not Murdered", toolbar_location=None, tools="hover", tooltips="@Murdered: @Value", x_range=(-.5, .5)) fig.annular_wedge(x=0, y=1, inner_radius=0.15, outer_radius=0.25, direction="anticlock", start_angle=cumsum('Angle', include_zero=True), end_angle=cumsum('Angle'), line_color="white", fill_color='Color', legend_label='Murdered', source=df_mur) fig.axis.axis_label=None fig.axis.visible=False fig.grid.grid_line_color = None show(fig)
大多數(shù)人在游戲中被謀殺,但大部分?jǐn)?shù)據(jù)丟失。所以我們不能說大多數(shù)人是在游戲中被謀殺的。
散點(diǎn)圖
首先,將創(chuàng)建 Sabotages fixed 和 Minutes 的數(shù)據(jù)框,并更改列名并在其中添加 T。
df_min = pd.crosstab(df['Min'], df['Sabotages Fixed']).reset_index() df_min = df_min.rename(columns={0.0:'0T', 1.0:'1T', 2.0:'2T',3.0:'3T',4.0:'4T',5.0:'5T' }) df_min[:2]
將 3 次破壞固定為 0,1 和 2
并創(chuàng)建一個數(shù)據(jù)框。
df_0 = df_min[['Min', '0T']] df_1 = df_min[['Min', '1T']] df_2 = df_min[['Min', '2T']]
要制作只有一個圖例的簡單散點(diǎn)圖,我們可以傳遞數(shù)據(jù)并使用scatter()
它來制作圖表。
df_min.plot_Bokeh.scatter(x='Min', y='1T')
要制作包含多個圖例的散點(diǎn)圖,我們需要使用圓圈;這是圖形對象的一種方法。圓圈是Bokeh提供的眾多繪圖樣式之一,您可以使用三角形或更多。
fig = figure(title='Sabotages Fixed vs Minutes', tools= 'hover', toolbar_location="above", toolbar_sticky=False) fig.circle(x="Min",y='0T', size=12, alpha=0.5, color="#F78888", legend_label='0T', source=df_0), fig.circle(x="Min",y='1T', size=12, alpha=0.5, color="blue", legend_label='1T', source=df_1), fig.circle(x="Min",y='2T', size=12, alpha=0.5, color="#626262", legend_label='2T', source=df_2), show(fig)
簡單直方圖
看看游戲之間的分鐘分布。將用hist
來繪制直方圖。
df_minutes = df['Min'].astype('int64') df_minutes.plot_Bokeh(kind='hist', title='Distribution of Minutes')
大多數(shù)比賽有6分鐘到14分鐘的時間。
堆積直方圖
看看游戲長度是否會增加,因此冒名頂替者和船員會減少還是增加。我們將使用 hist
來制作堆疊直方圖。
df_gm_te = pd.crosstab(df['Game Length'], df['Team']) df_gm_te
df_gm_te.plot_Bokeh.hist(title='Gamelegth vs Imposter/Crewmate', figsize=(750, 350))
Bokeh中的堆疊直方圖
冒名頂替者不傾向于長時間玩游戲,他們只想殺死所有火葬并贏得游戲。
不同類型的條形圖
簡單條形圖
看看給定的任務(wù)是否由人完成。如果所有任務(wù)都完成,那么自動火葬將獲勝。
df_tc = pd.DataFrame(df['Task Completed'].value_counts())[1:].sort_index().rename(columns={'Task Completed': 'Count'}) df_tc.plot_Bokeh(kind='bar', y='Count', title='How many people have completed given task?', figsize=(750, 350))
Bokeh中的條形圖
完成最多的任務(wù)是 7 個,完成最少的任務(wù)是 10 個。
堆積條形圖
看看誰贏了:冒名頂替者或火葬。我一直覺得冒名頂替者獲勝最多,因?yàn)樗麄冎挥幸环莨ぷ骺梢詺⑺浪腥恕?/p>
df1 = pd.crosstab(df['Team'], df['Outcome']) df1.plot_Bokeh.bar(title='Who wins: Imposter or Crewmates',stacked=True, figsize=(550, 350))
Bokeh中的堆積條形圖
冒名頂替者比 Crewmates 贏得更多。Imposter贏得或輸?shù)舯荣悰]有太大區(qū)別,價值非常接近。很多情況下,他們有5個火葬場和4個冒名頂替者。
堆積垂直條形圖
完成任務(wù)會不會贏得比賽讓我們拭目以待。
df['All Tasks Completed'].replace(['Yes','No'], ['Tasks Completed','Tasks Not Completed'], inplace=True) df2 = pd.crosstab(df['Outcome'], df['All Tasks Completed']) df2.plot_Bokeh.barh(title='Completeing task: win or loss', stacked=True, figsize=(650, 350))
Bokeh中的堆積條形圖
完成任務(wù)將自動贏得火葬。完成任務(wù)贏得比賽的人數(shù)更多。
雙向條形圖
用雙向條形圖看看用戶是贏了還是輸了。要制作雙向條形圖,我們需要將一個度量設(shè)為負(fù)值,這里我們將損失特征設(shè)為負(fù)值。
df_user = pd.crosstab(df['User ID'], df['Outcome']).reset_index() df_user['Loss'] = df_user['Loss']*-1 df_user['User ID'] = (df_user.index+1).astype(str) + ' User' df_user = df_user.set_index('User ID') df_user[:2]
現(xiàn)在完成上面的過程后,我們只需要barh()
在兩個方向上制作一個條形圖即可。
df_user.plot_Bokeh.barh(title='Users: Won or Defeat')
Bokeh中的雙向條形圖
從圖表中,我們可以輕松區(qū)分用戶是被擊敗還是贏得了比賽。
折線圖
看看游戲中火化的排出比例。我們將line
用來制作折線圖。
df_crewmate = df[df['Team'] == 'Crewmate'] df_t_ej = pd.crosstab(df_crewmate['User ID'], df_crewmate['Ejected']).reset_index() df_t_ej = df_t_ej[['No','Yes']] df_t_ej.plot_Bokeh.line(title='Cremates Memebers: Ejected vs Minutes', figsize=(750, 350))
Bokeh中的折線圖
沒有被逐出游戲的成員存在很大差異。
棒棒糖圖表
將獲勝的前 10 名用戶的圖表可視化。我在所有用戶 ID 中添加了一個用戶字符串。數(shù)據(jù)框看起來像這樣。
df_user_new = pd.crosstab(df['User ID'], df['Outcome']).reset_index().sort_values(by='Win', ascending=False)[:10] df_user_new['User ID'] = (df_user_new.index+1).astype(str) + ' User' df_user_new[:2]
在此圖表中,我們將從圖表中刪除 x 軸和 y 軸網(wǎng)格線。為了制作棒棒糖圖表,我們需要結(jié)合 segment() 和circle()。
x = df_user_new['Win'] factors = df_user_new['User ID'] #.values fig = figure(title="Top 10 Users: Win", toolbar_location=None,tools="hover", tooltips="@x", y_range=factors, x_range=[0,75], plot_width=750, plot_height=350) fig.segment(0, factors, x, factors, line_width=2, line_color="#3182bd") fig.circle(x, factors, size=15, fill_color="#9ecae1", line_color="#3182bd", line_width=3) fig.xgrid.grid_line_color = None fig.ygrid.grid_line_color = None show(fig)
Bokeh中的棒棒糖圖
面積圖
看看在這段時間(分鐘)內(nèi)修復(fù)了多少破壞事件。在這里為了簡單起見,我們將只看到兩個破壞活動 0th 和 1st。
from Bokeh.models import ColumnDataSource from Bokeh.plotting import figure, output_file, show # data df_min = pd.crosstab(df['Min'], df['Sabotages Fixed']).reset_index() df_min = df_min.rename(columns={0.0:'0T', 1.0:'1T',2.0:'2T',3.0:'3T',4.0:'4T',5.0:'5T'}) # chart names = ['0T','1T'] source = ColumnDataSource(data=dict(x = df_min.Min, y0 = df_min['0T'], y1 = df_min['1T'])) fig = figure(width=400, height=400, title='Sabotages Fied vs Minutes') fig.varea_stack(['y0','y1'], x='x', color=("grey", "lightgrey"),legend_label=names, source=source) fig.grid.grid_line_color = None fig.xaxis.axis_label='Minutes' show(fig)
Bokeh中的面積圖
隨著時間的增加,破壞活動會減少。
到目前為止,我們已經(jīng)看到了Bokeh中的所有基本圖表,現(xiàn)在看看如何在Bokeh中使用布局。這將幫助我們創(chuàng)建儀表板或應(yīng)用程序。因此,我們可以將特定用例的所有信息集中在一個地方。
Bokeh庫的布局功能
Layout 函數(shù)將讓我們構(gòu)建一個由繪圖和小部件組成的網(wǎng)格。我們可以在一個布局中擁有盡可能多的行和列或網(wǎng)格。
有許多可用的布局選項(xiàng):
- 如果要垂直顯示圖,請使用**
column()
**函數(shù)。 - 如果要水平顯示圖,請使用**
row()
**函數(shù)。 - 如果您希望以網(wǎng)格方式繪制圖形,請使用**
gridplot()
**函數(shù)。 - 如果您希望圖表以最佳方式放置,請使用**
layout()
**函數(shù)
取一個虛擬數(shù)據(jù)。
from Bokeh.io import output_file, show from Bokeh.layouts import row,column from Bokeh.plotting import figure output_file("layout.html") x = list(range(11)) y0 = x y1 = [10 - i for i in x] y2 = [abs(i - 5) for i in x] # create three plots s1 = figure(width=250, height=250, background_fill_color="#fafafa") s1.circle(x, y0, size=12, color="#53777a", alpha=0.8) s2 = figure(width=250, height=250, background_fill_color="#fafafa") s2.triangle(x, y1, size=12, color="#c02942", alpha=0.8) s3 = figure(width=250, height=250, background_fill_color="#fafafa") s3.square(x, y2, size=12, color="#d95b43", alpha=0.8)
如果我們使用 column()
函數(shù),輸出將如下所示。
show(column(s1, s2, s3))
如果我們使用 row()
函數(shù),輸出將如下所示。
# 將結(jié)果排成一行并顯示 show(row(s1, s2, s3))
在 Bokeh 中制作儀表板布局。在這里我拍了三張圖表,一張是棒棒糖圖,另外兩張是Bokeh的餅圖。
在Bokeh中設(shè)置布局的主要邏輯是我們希望如何設(shè)置圖表。創(chuàng)建一個如下圖所示的設(shè)計。
layout = grid([[fig1], [fig2, fig3]])
在 Bokeh 中運(yùn)行儀表板布局的整個代碼。
from Bokeh.io import output_file, show from Bokeh.plotting import figure from Bokeh.layouts import column, grid # 1 layout df_user_new = pd.crosstab(df['User ID'], df['Outcome']).reset_index().sort_values(by='Win', ascending=False)[:10] df_user_new['User ID'] = (df_user_new.index+1).astype(str) + ' User' x = df_user_new['Win'] factors = df_user_new['User ID'] fig1 = figure(title="Top 10 Users: Win", toolbar_location=None, tools="hover", tooltips="@x", y_range=factors, x_range=[0,75], width=700, height=250) fig1.segment(0, factors, x, factors, line_width=2, line_color="#3182bd") fig1.circle(x, factors, size=15, fill_color="#9ecae1", line_color="#3182bd", line_width=3) # 2 layout df_mur = df.Murdered.value_counts().reset_index().rename(columns={'index': 'Murdered', 'Murdered': 'Value'}) df_mur['Angle'] = df_mur['Value']/df_mur['Value'].sum() * 2*pi df_mur['Color'] = ['#3182bd', '#6baed6', '#9ecae1'] fig2 = figure(height=300,width=400, title="Ration of Murdered vs Not Murdered", toolbar_location=None, tools="hover", tooltips="@Murdered: @Value", x_range=(-.5, .5)) fig2.annular_wedge(x=0, y=1, inner_radius=0.15, outer_radius=0.25, direction="anticlock", start_angle=cumsum('Angle', include_zero=True), end_angle=cumsum('Angle'), line_color="white", fill_color='Color', legend_label='Murdered', source=df_mur) # 3 layout df_team = pd.DataFrame(df.Team.value_counts()).reset_index().rename(columns={'index': 'Team', 'Team': 'Value'}) df_team['Angle'] = df_team['Value']/df_team['Value'].sum() * 2*pi df_team['Color'] = ['#3182bd', '#6baed6'] fig3 = figure(height=300, width=300, title="Ration of Cremates vs Imposter", toolbar_location=None, tools="hover", tooltips="@Team: @Value", x_range=(-.5, .5)) fig3.annular_wedge(x=0, y=1, inner_radius=0.15, outer_radius=0.25, direction="anticlock", start_angle=cumsum('Angle', include_zero=True), end_angle=cumsum('Angle'), line_color="white", fill_color='Color', legend_label='Team', source=df_team) # Styling for fig in [fig1, fig2, fig3]: fig.grid.grid_line_color = None for fig in [fig2, fig3]: fig.axis.visible=False fig.axis.axis_label=None layout = grid([ [fig1], [fig2, fig3] ]) show(layout)
技術(shù)交流
歡迎轉(zhuǎn)載、收藏、有所收獲點(diǎn)贊支持一下!
到此這篇關(guān)于Python庫?Bokeh?數(shù)據(jù)可視化實(shí)用指南的文章就介紹到這了,更多相關(guān)Python?Bokeh數(shù)據(jù)可視化內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
- Bokeh:Python交互式可視化的利器詳解
- Python?Bokeh實(shí)現(xiàn)實(shí)時數(shù)據(jù)可視化
- python使用Bokeh庫實(shí)現(xiàn)實(shí)時數(shù)據(jù)的可視化
- Python使用Bokeh庫實(shí)現(xiàn)炫目的交互可視化
- Python使用Bokeh進(jìn)行交互式數(shù)據(jù)可視化
- Python使用Bokeh實(shí)現(xiàn)交互式圖表的創(chuàng)建
- Python利用Bokeh進(jìn)行數(shù)據(jù)可視化的教程分享
- python基于Bokeh庫制作子彈圖及瀑布圖示例教程
- Python 交互式可視化的利器Bokeh的使用
相關(guān)文章
Python基于ssh遠(yuǎn)程連接Mysql數(shù)據(jù)庫操作
這篇文章主要為大家介紹了Python基于ssh遠(yuǎn)程連接Mysql數(shù)據(jù)庫操作示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-06-06Python/MySQL實(shí)現(xiàn)Excel文件自動處理數(shù)據(jù)功能
在沒有服務(wù)器存儲數(shù)據(jù),只有excel文件的情況下,如何利用SQL和python實(shí)現(xiàn)數(shù)據(jù)分析和數(shù)據(jù)自動處理的功能?本文就來和大家聊聊解決辦法2023-02-02pytorch自定義不可導(dǎo)激活函數(shù)的操作
這篇文章主要介紹了pytorch自定義不可導(dǎo)激活函數(shù)的操作,具有很好的參考價值,希望大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2021-06-06使用Python實(shí)現(xiàn)MongoDB數(shù)據(jù)轉(zhuǎn)表格文件CSV
這篇文章主要為大家詳細(xì)介紹了如何使用Python實(shí)現(xiàn)將MongoDB中的數(shù)據(jù)轉(zhuǎn)換為表格文件(如CSV)以便于數(shù)據(jù)交換、共享或?qū)氲狡渌到y(tǒng)進(jìn)行分析,需要的可以參考下2024-04-04Python中g(shù)lob.glob()函數(shù)的使用
glob 模塊用于查找規(guī)定路徑下的文件路徑名,本文主要介紹了Python中g(shù)lob.glob()函數(shù)的使用,具有一定的參考價值,感興趣的可以了解一下2024-03-03超詳細(xì)圖解修改pip?install默認(rèn)安裝路徑的方法
windows環(huán)境下Python pip安裝庫的時候,默認(rèn)安裝在c盤,下面這篇文章主要給大家介紹了關(guān)于修改pip?install默認(rèn)安裝路徑的相關(guān)資料,文中通過實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下2022-07-07python3操作微信itchat實(shí)現(xiàn)發(fā)送圖片
這篇文章主要為大家詳細(xì)介紹了python3操作微信itchat實(shí)現(xiàn)發(fā)送圖片,具有一定的參考價值,感興趣的小伙伴們可以參考一下2018-02-02