欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

python數(shù)據(jù)分析繪圖可視化

 更新時間:2022年06月30日 17:05:18   作者:宇文云初  
這篇文章主要介紹了python數(shù)據(jù)分析繪圖可視化,數(shù)據(jù)可視化旨在直觀展示信息的分析結(jié)果和構(gòu)思,令某些抽象數(shù)據(jù)具象化,這些抽象數(shù)據(jù)包括數(shù)據(jù)測量單位的性質(zhì)或數(shù)量

前言:

數(shù)據(jù)分析初始階段,通常都要進行可視化處理。數(shù)據(jù)可視化旨在直觀展示信息的分析結(jié)果和構(gòu)思,令某些抽象數(shù)據(jù)具象化,這些抽象數(shù)據(jù)包括數(shù)據(jù)測量單位的性質(zhì)或數(shù)量。本章用的程序庫matplotlib是建立在Numpy之上的一個Python圖庫,它提供了一個面向?qū)ο蟮腁PI和一個過程式類的MATLAB API,他們可以并行使用。

1、

import numpy as np
import matplotlib.pyplot as plt
scores=np.random.randint(0,100,50)
plt.hist(scores,bins=8,histtype=‘stepfilled')
plt.title(‘37')
plt.show()

2、

x=np.arange(6)
y1=np.array([1,4,3,5,6,7])
y2=np.array([3,4,3,5,6,7])
y3=np.array([2,4,3,5,6,7])
plt.stackplot(x,y1,y2,y3)
plt.title(‘37')
plt.show()

3、

random_state=np.random.RandomState(1231241)
random_x=random_state.randn(10000)
plt.hist(random_x,bins=25)
plt.title(‘37')
plt.show()

4、

data=np.array([10,30,15,30,15])
pie_labels=np.array([‘A',‘B',‘C',‘D',‘E'])
plt.pie(data,radius=1.5,labels=pie_labels,autopct='%3.1f%%')
plt.title(‘37')
plt.show()

5、

import matplotlib as mpl
mpl.rcParams[‘font.sans-serif']=[‘SimHei']
mpl.rcParams[‘a(chǎn)xes.unicode_minus']=False
kinds=[‘購物',‘禮尚往來',‘餐飲美食',‘通信',‘生活日用',‘交通出行',‘休閑娛樂',‘其他']
money_scale=[500/1500,123/1500,400/1500,234/1500,300/1500,200/1500,100/1500,150/1500]
dev_position=[0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1]
plt.pie(money_scale,labels=kinds,autopct='%3.1f%%',shadow=True,
explode=dev_position,startangle=90)
plt.title(‘37')
plt.show()

6、

num=50
x=np.random.rand(num)
y=np.random.rand(num)
plt.scatter(x,y)
plt.title(‘37')
plt.show()

7、

num=50
x=np.random.rand(num)
y=np.random.rand(num)
area=(800*np.random.rand(num)**2)
plt.scatter(x,y,s=area)
plt.title(‘37')
plt.show()

8、

plt.rcParams[‘font.sans-serif']=‘SimHei'
plt.rcParams[‘a(chǎn)xes.unicode_minus']=False
x_speed=np.arange(10,210,10)
y_distance=np.array([0.3,0.5,1,3,5,5.5,7,8,9,12,14,15.5,17.8,19,20,23,27,30,31,32])
plt.scatter(x_speed,y_distance,s=50,alpha=0.9)
plt.title(‘37')
plt.show()

9、

plt.rcParams[‘font.family']= ‘SimHei'
plt.rcParams[‘a(chǎn)xes.unicode_minus']=False
data_2018=np.array([4500,6654.5,5283.4,5107.8,5443.3,5550.6,6400.2,6404.9,5483.1,5330.2,5543,6199.9])
data_2017=np.array([4605.2,4710.3,5168.9,4767.2,4947,5203,6047.4,5945.5,5219.6,5038.1,5196.3,5698.6])
plt.boxplot([data_2018,data_2017],labels=(‘2018年',‘2017年'),meanline=True,widths=0.5,vert=False,patch_artist=True)
plt.title(‘37')
plt.show()

10、

plt.rcParams[‘font.family']= ‘SimHei'
plt.rcParams[‘a(chǎn)xes.unicode_minus']=False
dim_num=6
data=np.array([[0.50,0.32,0.35,0.30,0.30,0.88],
[0.45,0.35,0.30,0.40,0.40,0.30],
[0.43,0.99,0.30,0.28,0.22,0.30],
[0.30,0.25,0.48,0.95,0.45,0.40],
[0.20,0.38,0.87,0.45,0.32,0.28],
[0.34,0.31,0.38,0.40,0.92,0.28]])
angles=np.linspace(0, 2 * np.pi, dim_num, endpoint=False)
angles=np.concatenate((angles,[angles[0]]))
data=np.concatenate((data,[data[0]]))
radar_labels=[‘研究型(I)',‘藝術(shù)型(A)',‘社會型(S)',‘企業(yè)型(E)',‘傳統(tǒng)型?',‘現(xiàn)實型?']
radar_labels=np.concatenate((radar_labels, [radar_labels[0]]))
plt.polar(angles, data)
plt.thetagrids(angles * 180/np.pi, labels=radar_labels)
plt.fill(angles, data, alpha=0.25)
plt.title(‘37')
plt.show()

11、

data =np.array([20,50,10,15,30,55])
pie_labels=np.array([‘A',‘B',‘C',‘D',‘E',‘F'])
plt.pie(data,radius=1.5,wedgeprops={‘width': 0.7},labels=pie_labels,autopct='%3.1f%%',pctdistance=0.75)
plt.title(‘37')
plt.show()

12、

x = np.arange(1,13)
y_a = np.array([191,123,234,42,123,432,567,234,231,132,123,134])
y_b = np.array([123,143,234,242,523,232,467,334,131,332,234,345])
y_c = np.array([91,123,534,432,223,332,367,434,111,322,345,560])
plt.stackplot(x,y_a,y_b,y_c)
plt.title(‘37')
plt.show()

到此這篇關(guān)于python數(shù)據(jù)分析繪圖可視化的文章就介紹到這了,更多相關(guān)python 可視化內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • python sklearn數(shù)據(jù)預處理之正則化詳解

    python sklearn數(shù)據(jù)預處理之正則化詳解

    數(shù)據(jù)的預處理是數(shù)據(jù)分析,或者機器學習訓練前的重要步驟,這篇文章主要為大家詳細介紹了sklearn數(shù)據(jù)預處理中正則化的相關(guān)知識,需要的可以參考下
    2023-10-10
  • Python+Redis實現(xiàn)布隆過濾器

    Python+Redis實現(xiàn)布隆過濾器

    布隆過濾器(Bloom Filter)是1970年由布隆提出的。它實際上是一個很長的二進制向量和一系列隨機映射函數(shù)。這篇文章主要介紹了Python+Redis實現(xiàn)布隆過濾器,需要的朋友可以參考下
    2019-12-12
  • NumPy內(nèi)存布局的實現(xiàn)

    NumPy內(nèi)存布局的實現(xiàn)

    本文主要介紹了NumPy內(nèi)存布局的實現(xiàn),括連續(xù)內(nèi)存布局(C順序)和分散內(nèi)存布局(Fortran順序),并通過實例演示如何操作數(shù)組的內(nèi)存布局,感興趣的可以了解一下
    2024-01-01
  • Pyqt QImage 與 np array 轉(zhuǎn)換方法

    Pyqt QImage 與 np array 轉(zhuǎn)換方法

    今天小編就為大家分享一篇Pyqt QImage 與 np array 轉(zhuǎn)換方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2019-06-06
  • Python解決多進程間訪問效率低的方法總結(jié)

    Python解決多進程間訪問效率低的方法總結(jié)

    這篇文章主要為大家詳細介紹了當Python多進程間訪問效率低時,應該如何解決?文中的示例代碼講解詳細,感興趣的小伙伴可以了解一下
    2022-09-09
  • python排序函數(shù)sort()與sorted()的區(qū)別

    python排序函數(shù)sort()與sorted()的區(qū)別

    這篇文章主要介紹了python排序函數(shù)sort()與sorted()的區(qū)別,需要的朋友可以參考下
    2018-09-09
  • Python實現(xiàn)的彩票機選器實例

    Python實現(xiàn)的彩票機選器實例

    這篇文章主要介紹了Python實現(xiàn)彩票機選器的方法,可以模擬彩票號碼的隨機生成功能,需要的朋友可以參考下
    2015-06-06
  • python Django批量導入數(shù)據(jù)

    python Django批量導入數(shù)據(jù)

    這篇文章主要為大家詳細介紹了python Django批量導入數(shù)據(jù)的相關(guān)資料感興趣的小伙伴們可以參考一下
    2016-03-03
  • 淺析python中的set類型

    淺析python中的set類型

    這篇文章主要介紹了python中的set類型,本文給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
    2022-06-06
  • 利用python爬取散文網(wǎng)的文章實例教程

    利用python爬取散文網(wǎng)的文章實例教程

    這篇文章主要跟大家介紹了利用python爬取散文網(wǎng)文章的相關(guān)資料,文中介紹的非常詳細,對大家具有一定的參考學習價值,需要的朋友們下面來一起看看吧。
    2017-06-06

最新評論