目录
1.线形图
2.柱状图
3.直方图
4. 密度图
5.散点图
Pandas中集成了Matplotlib中的基础组件,让绘图更方便。

目录
1.线形图
2.柱状图
3.直方图
4. 密度图
5.散点图
Pandas中集成了Matplotlib中的基础组件,让绘图更方便。
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
df = pd.DataFrame({'normal':np.random.normal(size = 50),'gamma':np.random.gamma(1,size = 50)})
df.plot()
df = pd.DataFrame(np.random.randint(1,100,size = (3,3)),index =
{'one','two','three'},columns = ['I1','I2','I3'])
df.plot(kind = 'barh')
wy = pd.Series(np.random.normal(size = 50)) s.hist(bins = 15,grid = False,color='green')
wy = pd.Series(np.random.normal(size = 100)) s.plot(kind = 'kde',color='red')
wd = pd.DataFrame(np.arange(10),columns = ['A']) wd['B'] = 2*wd['A']*wd['A']+4 wd.plot(kind = 'scatter',x = 'A',y = 'B',color='yellow')