Skip to content

DatetimeIndex with closed='left' or 'right' drop dates at the boundaries #11804

Closed
@thrasibule

Description

@thrasibule

When either start or end is at the boundary of a date_range, they get dropped when they shouldn't if we specify the closed argument, see example below:

In [1]: pd.date_range('2015-09-12', '2015-10-30', freq='QS-MAR', closed='right')
Out[1]: DatetimeIndex([], dtype='datetime64[ns]', freq='QS-MAR')

In [2]: pd.date_range('2015-09-01', '2015-10-30', freq='QS-MAR', closed='left')
Out[2]: DatetimeInddex([], dtype='datetime64[ns]', freq='QS-MAR')

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions