自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Seaborn常用的10種數(shù)據(jù)分析圖表

大數(shù)據(jù) 數(shù)據(jù)分析
seaborn內(nèi)置了十幾個(gè)示例數(shù)據(jù)集,通過load_dataset函數(shù)可以調(diào)用。其中包括常見的泰坦尼克、鳶尾花等經(jīng)典數(shù)據(jù)集。

內(nèi)置示例數(shù)據(jù)集

[[336808]]

seaborn內(nèi)置了十幾個(gè)示例數(shù)據(jù)集,通過load_dataset函數(shù)可以調(diào)用。其中包括常見的泰坦尼克、鳶尾花等經(jīng)典數(shù)據(jù)集。

  1. # 查看數(shù)據(jù)集種類 
  2. import seaborn as sns 
  3. sns.get_dataset_names() 

 

seaborn常用的10種數(shù)據(jù)分析圖表

 

 

  1. import seaborn as sns 
  2. # 導(dǎo)出鳶尾花數(shù)據(jù)集 
  3. data = sns.load_dataset('iris') 
  4. data.head() 

 

seaborn常用的10種數(shù)據(jù)分析圖表

 

1. 散點(diǎn)圖

函數(shù)sns.scatterplot

  1. import seaborn as sns 
  2. sns.set() 
  3. import matplotlib.pyplot as plt 
  4. %matplotlib inline 
  5. # 小費(fèi)數(shù)據(jù)集 
  6. tips = sns.load_dataset('tips') 
  7. ax = sns.scatterplot(x='total_bill',y='tip',data=tips
  8. plt.show() 
seaborn常用的10種數(shù)據(jù)分析圖表

2. 條形圖

函數(shù)sns.barplot顯示數(shù)據(jù)平均值和置信區(qū)間

  1. import seaborn as sns 
  2. sns.set() 
  3. import matplotlib.pyplot as plt 
  4. %matplotlib inline 
  5. # 小費(fèi)數(shù)據(jù)集 
  6. tips = sns.load_dataset("tips") 
  7. ax = sns.barplot(x="day"y="total_bill"data=tips
  8. plt.show() 
seaborn常用的10種數(shù)據(jù)分析圖表

3. 線型圖

函數(shù)sns.lineplot繪制折線圖和置信區(qū)間

  1. import seaborn as sns 
  2. sns.set() 
  3. import matplotlib.pyplot as plt 
  4. %matplotlib inline 
  5. fmri = sns.load_dataset("fmri") 
  6. ax = sns.lineplot(x="timepoint"y="signal"data=fmri
  7. plt.show() 
seaborn常用的10種數(shù)據(jù)分析圖表

4. 箱線圖

函數(shù)seaborn.boxplot

  1. import seaborn as sns 
  2. sns.set() 
  3. import matplotlib.pyplot as plt 
  4. %matplotlib inline 
  5. tips = sns.load_dataset("tips") 
  6. ax = sns.boxplot(x="day"y="total_bill"data=tips
  7. plt.show() 
seaborn常用的10種數(shù)據(jù)分析圖表

5. 直方圖

函數(shù)seaborn.distplot

  1. import seaborn as sns 
  2. import numpy as np 
  3. sns.set() 
  4. import matplotlib.pyplot as plt 
  5. %matplotlib inline 
  6.  
  7. np.random.seed(0) 
  8. x = np.random.randn(1000) 
  9. ax = sns.distplot(x) 
  10. plt.show() 
seaborn常用的10種數(shù)據(jù)分析圖表

6. 熱力圖

函數(shù)seaborn.heatmap

  1. import numpy as np 
  2. np.random.seed(0) 
  3. import seaborn as sns  
  4. sns.set() 
  5. import matplotlib.pyplot as plt 
  6. %matplotlib inline 
  7.  
  8. uniform_data = np.random.rand(10, 12) 
  9. ax = sns.heatmap(uniform_data) 
  10. plt.show() 

seaborn常用的10種數(shù)據(jù)分析圖表

7. 散點(diǎn)圖矩陣

函數(shù)sns.pairplot

  1. import seaborn as sns 
  2. sns.set() 
  3. import matplotlib.pyplot as plt 
  4. %matplotlib inline 
  5.  
  6. iris = sns.load_dataset("iris") 
  7. ax = sns.pairplot(iris) 
  8.  
  9. plt.show() 
seaborn常用的10種數(shù)據(jù)分析圖表

8. 分類散點(diǎn)圖

函數(shù)seaborn.catplot

  1. import seaborn as sns 
  2. sns.set() 
  3. import matplotlib.pyplot as plt 
  4. %matplotlib inline 
  5.  
  6. exercise = sns.load_dataset("exercise") 
  7. ax = sns.catplot(x="time"y="pulse"hue="kind"data=exercise)\ 
  8.  
  9. plt.show() 

seaborn常用的10種數(shù)據(jù)分析圖表

9. 計(jì)數(shù)條形圖

函數(shù)seaborn.countplot

  1. import seaborn as sns 
  2. sns.set() 
  3. import matplotlib.pyplot as plt 
  4. %matplotlib inline 
  5.  
  6. titanic = sns.load_dataset("titanic") 
  7. ax = sns.countplot(x="class"data=titanic
  8.  
  9. plt.show() 
seaborn常用的10種數(shù)據(jù)分析圖表

10. 回歸圖

函數(shù) seaborn.lmplot繪制散點(diǎn)及回歸圖

  1. import seaborn as sns 
  2. sns.set() 
  3. import matplotlib.pyplot as plt 
  4. %matplotlib inline 
  5.  
  6. tips = sns.load_dataset("tips") 
  7. ax = sns.lmplot(x="total_bill"y="tip"data=tips
  8.  
  9. plt.show() 

 

seaborn常用的10種數(shù)據(jù)分析圖表

 

 

責(zé)任編輯:趙寧寧 來源: 今日頭條
相關(guān)推薦

2020-04-29 09:17:42

Seaborn數(shù)據(jù)可視化數(shù)據(jù)分析

2020-12-22 15:33:42

數(shù)據(jù)分析技術(shù)IT

2017-08-01 16:42:09

數(shù)據(jù)分析互聯(lián)網(wǎng)

2019-05-06 09:27:13

數(shù)據(jù)分析大數(shù)據(jù)開發(fā)數(shù)據(jù)

2020-03-23 09:53:26

大數(shù)據(jù)IT技術(shù)

2022-09-07 15:47:21

數(shù)據(jù)分析對(duì)比分析大數(shù)據(jù)

2022-08-26 16:21:47

數(shù)據(jù)分析工具運(yùn)營(yíng)

2023-08-01 16:01:59

可視化Seaborn

2017-06-28 14:54:17

大數(shù)據(jù)數(shù)據(jù)分析

2020-12-07 05:51:49

數(shù)據(jù)分析數(shù)據(jù)可視化數(shù)據(jù)科學(xué)

2024-01-26 13:23:22

數(shù)據(jù)分析指標(biāo)監(jiān)控型

2024-12-31 12:09:31

2017-09-21 13:04:35

數(shù)據(jù)挖掘分析分析方法數(shù)據(jù)分析師

2021-02-28 12:47:27

數(shù)據(jù)分析科學(xué)技術(shù)

2020-10-08 11:24:04

數(shù)據(jù)分析技術(shù)IT

2017-08-15 18:55:57

大數(shù)據(jù)數(shù)據(jù)可視化圖表

2022-03-15 12:27:57

數(shù)據(jù)分析工具技能

2020-09-08 12:48:19

數(shù)據(jù)分析圖表互聯(lián)網(wǎng)

2019-06-06 16:30:02

數(shù)據(jù)分析圖表大數(shù)據(jù)

2021-04-11 09:59:03

編程語言數(shù)據(jù)分析Python
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)