Examples
import numpy as np
import pandas as pd
pd.timedelta_range(start='2 day', periods=6)
The closed parameter specifies which endpoint is included. The default behavior is to include both endpoints.
pd.timedelta_range(start='2 day', periods=5, closed='right')
The freq parameter specifies the frequency of the TimedeltaIndex. Only fixed frequencies can be passed,
non-fixed frequencies such as ‘M’ (month end) will raise.
pd.timedelta_range(start='2 day', end='3 days', freq='6H')
Specify start, end, and periods; the frequency is generated automatically (linearly spaced).
pd.timedelta_range(start='2 day', end='5 days', periods=4)