Skip to content

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

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
lzy1g1225 opened this issue Sep 4, 2021 · 1 comment · Fixed by #43504
Closed
Labels
API - Consistency Internal Consistency of API/Behavior Bug Datetime Datetime data dtype
Milestone

Comments

@lzy1g1225
Copy link

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

@lzy1g1225 lzy1g1225 added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 4, 2021
@attack68
Copy link
Contributor

attack68 commented Sep 4, 2021

link to #40245

@mzeitlin11 mzeitlin11 added API - Consistency Internal Consistency of API/Behavior Datetime Datetime data dtype and removed Needs Triage Issue that has not been reviewed by a pandas team member labels Sep 11, 2021
@mzeitlin11 mzeitlin11 added this to the Contributions Welcome milestone Sep 11, 2021
@jreback jreback modified the milestones: Contributions Welcome, 1.4 Sep 15, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
API - Consistency Internal Consistency of API/Behavior Bug Datetime Datetime data dtype
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants