pandas date range

Solutions on MaxInterview for pandas date range by the best coders in the world

showing results for - "pandas date range"
Mirko
20 Jul 2017
1index = pd.date_range(start='2020-8-15', end = '2021-8-11', freq='M')
2print(index)
3
4>>>DatetimeIndex(['2020-08-31', '2020-09-30', '2020-10-31', '2020-11-30',
5                 '2020-12-31', '2021-01-31', '2021-02-28', '2021-03-31',
6                 '2021-04-30', '2021-05-31', '2021-06-30', '2021-07-31'],
7                 dtype='datetime64[ns]', freq='M')
Enrico
25 Jul 2020
1>>> pd.date_range(start='1/1/2018', periods=5, freq='3M')
2DatetimeIndex(['2018-01-31', '2018-04-30', '2018-07-31', '2018-10-31',
3               '2019-01-31'],
4              dtype='datetime64[ns]', freq='3M')
5
Christopher
20 Jan 2017
1>>> pd.date_range(start='1/1/2018', end='1/08/2018')
2DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03', '2018-01-04',
3               '2018-01-05', '2018-01-06', '2018-01-07', '2018-01-08'],
4              dtype='datetime64[ns]', freq='D')
5