我要使用pandas.date_range
函数,如下所示:
import pandas as pd
start_date = '01/08/2017 23:30'
end_date = '02/08/2017 23:30'
dates = pd.date_range(start_date, end_date, freq='min')
我希望August (08)
是我约会的月份,但是date_range
使用January (01)
和February (02)
作为月份。
print dates
DatetimeIndex(['2017-01-08 23:30:00', '2017-01-08 23:31:00',
'2017-01-08 23:32:00', '2017-01-08 23:33:00',
'2017-01-08 23:34:00', '2017-01-08 23:35:00',
'2017-01-08 23:36:00', '2017-01-08 23:37:00',
'2017-01-08 23:38:00', '2017-01-08 23:39:00',
...
'2017-02-08 23:21:00', '2017-02-08 23:22:00',
'2017-02-08 23:23:00', '2017-02-08 23:24:00',
'2017-02-08 23:25:00', '2017-02-08 23:26:00',
'2017-02-08 23:27:00', '2017-02-08 23:28:00',
'2017-02-08 23:29:00', '2017-02-08 23:30:00'],
dtype='datetime64[ns]', length=44641, freq='T')
如何解决此问题?