標籤:

Pandas學習-8pandas plot圖表

import pandas as pdimport numpy as npimport matplotlib.pyplot as plt#Seriesdata = pd.Series(np.random.randn(1000),index = np.arange(1000))data = data.cumsum()#累加#DataFramedata = pd.DataFrame(np.random.randn(1000,4), index=np.arange(1000), columns=list(abcd))print(data.head(3))#列印前3個data = data.cumsum()data.plot()#bar,scatter,box,kde,hist,pie,area,hexbinax = data.plot.scatter(x=a,y=b,color=DarkBlue,label=Class 1)data.plot.scatter(x="a",y = c,color=DarkGreen,label=Class 2,ax=ax)#列印兩組plt.show()

推薦閱讀:

如何與pandas愉快地玩耍(一)
如何與pandas愉快地玩耍(二)

TAG:pandas包 |