Skip to content

pd.date_range function not returns right bound when start=end and closed set to 'right' #43394

Closed
@lzy1g1225

Description

@lzy1g1225
pd.date_range(start='2021-09-02', end='2021-09-02', freq='D', closed=None)
pd.date_range(start='2021-09-02', end='2021-09-02', freq='D', closed='right')

Problem description

the first line returns 2021-09-02
but the second line returns empty( this is incorrect )

Expected Output

I think if we set closed to 'right', then the date range should still returns 2021-09-02, because start date equals end date and we want the end date, the formula would looks like (2021-09-02, 2021-09-02], right date should be picked instead of returns empty

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