Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

pandas.date_range

import pandas as pd
import datetime
pd.date_range("2018-01-01", "2018-01-10")
DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03', '2018-01-04', '2018-01-05', '2018-01-06', '2018-01-07', '2018-01-08', '2018-01-09', '2018-01-10'], dtype='datetime64[ns]', freq='D')
t1 = datetime.datetime.now()
t2 = datetime.datetime.now() + datetime.timedelta(days=10)
pd.date_range(t1, t2)
DatetimeIndex(['2020-11-01 19:58:04.158545', '2020-11-02 19:58:04.158545', '2020-11-03 19:58:04.158545', '2020-11-04 19:58:04.158545', '2020-11-05 19:58:04.158545', '2020-11-06 19:58:04.158545', '2020-11-07 19:58:04.158545', '2020-11-08 19:58:04.158545', '2020-11-09 19:58:04.158545', '2020-11-10 19:58:04.158545', '2020-11-11 19:58:04.158545'], dtype='datetime64[ns]', freq='D')