import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
Series
data = pd.Series(np.random.randn(1000),index=np.arange(1000))
data = data.cumsum()
data.plot()
plt.show()
DataFrame
data = pd.DataFrame(np.random.randn(1000,4),index=np.arange(1000),columns=list("ABCD"))
data = data.cumsum()
print(data.head())
data.plot()
plt.show()
A B C D
0 2.830178 -1.266763 0.066207 -1.447268
1 2.304518 -0.271237 0.858129 -1.317108
2 1.795170 0.786167 0.407461 -0.883278
3 1.300544 1.846025 0.848325 0.076735
4 2.489885 4.499346 0.177688 0.565535
plot methods:bar/hist/box/ked/area/scatter/hexbin/pie
abc = data.plot.scatter(x='A',y='B',color='DarkBlue',label='Class1')
data.plot.scatter(x='A',y='C',color='DarkGreen',label='Class2',ax=abc) #同一个绘图窗口
plt.show()
Pandas学习教程来源请戳这里