DateRange
self, start_date, end_date, step=1) time.DateRange(
Like range
but for dates, with an optional fixed interval between dates.
DateRange is a frozen dataclass.
Attributes
Methods
Name | Description |
---|---|
between |
Compute a new DateRange that represents the subset of dates in this range that are also between min_date and max_date (inclusive). |
overlap |
Compute a new DateRange that represents the subset of dates in this range that are also in the given TimeFrame. |
overlap_or_raise |
Compute a new DateRange that represents the subset of dates in this range that are also in the given TimeFrame. If there is no overlap, raise an error. |
to_pandas |
Convert the DateRange to a Pandas datetime index. |
to_numpy |
Convert the DateRange to a numpy datetime64 array. |
until_date |
Alternative constructor for DateRange when you aren’t sure of the precise end date: that is, you know roughly when the range ends but aren’t sure if that date is an exact number of steps after start date. |