parse_dates 表示将某一列设置为 时间类型
df = pd.read_csv('comptagevelo20152.csv', sep=',',index_col= 'Date',parse_dates=['Date'])
parse_dates将Date列设置为时间类型
index_col将Date列设置为索引
df.index
DatetimeIndex([‘2015-01-01’, ‘2015-02-01’, ‘2015-03-01’, ‘2015-04-01’,
‘2015-05-01’, ‘2015-06-01’, ‘2015-07-01’, ‘2015-08-01’,
‘2015-09-01’, ‘2015-10-01’,
…
‘2015-12-22’, ‘2015-12-23’, ‘2015-12-24’, ‘2015-12-25’,
‘2015-12-26’, ‘2015-12-27’, ‘2015-12-28’, ‘2015-12-29’,
‘2015-12-30’, ‘2015-12-31’],
dtype=‘datetime64[ns]’, name=‘Date’, length=365, freq=None)