# line plot series.plot() pyplot.show() 我们可以看到,这个序列似乎是随机的。 ? 我们还可以创建直方图,并确认分布是高斯分布。...0.0,1.0)for iin range(1000)] series= Series(series) # summary stats print(series.describe()) # line plot series.plot
pd.read_csv('car-sales.csv', header=0) # display first few rows print(series.head(5)) # line plot of dataset series.plot...index_col=0, squeeze=True, date_parser=parser) # summarize first few rows print(series.head()) # line plot series.plot...max-daily-temps.csv', header=0) # display first few rows print(series.head(5)) # line plot of dataset series.plot
线型图:Series和DataFrame都有自己的plot方法,plot默认创建的是线形图,Series.plot()和DataFrame.plot()。
read_csv('shampoo-sales.csv', header=0, parse_dates=[0], index_col=0, squeeze=True, date_parser=parser) series.plot
Series from matplotlibimport pyplot series= Series.from_csv('daily-total-female-births.csv', header=0) series.plot
Series from matplotlib import pyplot series = Series.from_csv('daily-total-female-births.csv', header=0) series.plot
series.plot(kind="density") diamonds["carat"].plot(kind="density", figsize=(8,8
from matplotlib import pyplot series = Series.from_csv('daily-minimum-temperatures.csv', header=0) series.plot
Series from matplotlibimport pyplot series= Series.from_csv('daily-minimum-temperatures.csv', header=0) series.plot
daily-minimum-temperatures.csv', header=0) # display first few rows print(series.head(20)) # line plot of dataset series.plot
Series.plot方法的参数 label:用于图表的标签 style:风格字符串,'g--' alpha:图像的填充不透明度(0-1) kind:图表类型(bar,line,hist,kde等) xticks
import pyplot series = Series.from_csv('daily-minimum-temperatures.csv', header=0) print(series.head()) series.plot
=0, parse\_dates=\[0\], index\_col=0, squeeze=True, date\_parser=parser) print(series.head()) series.plot
Series.from_csv('car-sales.csv', header=0) # display first few rows print(series.head(5)) # line plot of dataset series.plot
shampoo-sales.csv', header=0, parse_dates=[0], index_col=0, squeeze=True, date_parser=parser)print(series.head())series.plot
刻度标签的旋转(0到360) xticks 用于x轴刻度的值 yticks 用于y轴 xlim x轴范围(例如[0,10]) ylim y轴范围 grid 展示轴网格(默认是打开的) ▲表9-3 Series.plot
领取专属 10元无门槛券
手把手带您无忧上云