October 2018
Intermediate to advanced
252 pages
6h 49m
English
def parser(x): return datetime.strptime('200' + x, '%Y-%m')
series = read_csv('sales-of-shampoo-over-a-three-ye.csv', header=0, parse_dates=[0], index_col=0, squeeze=True,date_parser=parser)
print(series.head())
The output of the preceding code is as follows:
Month2001-01-01 266.02001-02-01 145.92001-03-01 183.12001-04-01 119.32001-05-01 180.3
series.plot()pyplot.show()
The output of the line plot is as follows: