Skip to content

Inconsistent date range behaviour #1573

New issue

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

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

Already on GitHub? Sign in to your account

Closed
ruidc opened this issue Jul 6, 2012 · 9 comments
Closed

Inconsistent date range behaviour #1573

ruidc opened this issue Jul 6, 2012 · 9 comments
Labels
Bug Frequency DateOffsets
Milestone

Comments

@ruidc
Copy link
Contributor

ruidc commented Jul 6, 2012

pandas.DatetimeIndex(start=datetime.datetime(2012, 2, 28), freq=pandas.offsets.YearEnd(month=2), periods=10)
works, but not
pandas.DatetimeIndex(start=datetime.datetime(2012, 2, 20), freq=pandas.offsets.MonthEnd(day=20), periods=10)

@changhiskhan
Copy link
Contributor

MonthEnd wasn't designed to be anchored like that. What you describe should be a separate "DayOfMonth" offset or some other flexible "2nd tuesday of the month" offset.

@sadruddin
Copy link

Wouldn't that rationale entail that there should also be a MonthOfYear offset as well?

@changhiskhan
Copy link
Contributor

Sorry, I don't mean the general concept of a month end should not be anchored. It's more of a practical consideration here that years have a fixed number of months. And there tends to be more variety of use cases for specifying monthly offsets.

Would you be interested in helping out with a PR? If you don't want to make separate DateOffset for this, just make sure that MonthBegin and the business month offsets also get the same treatment as MonthEnd. All that code is in pandas.tseries.offsets

Thanks!

@ruidc
Copy link
Contributor Author

ruidc commented Jul 9, 2012

You're right in that there's not much of a call for this, and for me, not enough of an itch to scratch, was more a case of inconsistency. If it gets itchier, will revisit then.

Thanks

@changhiskhan
Copy link
Contributor

Sounds good. I'll keep the issue open 'til the itch gets bad enough to scratch for whoever.
Thanks for the feedback!

@petehuang
Copy link
Contributor

Hi all,

This issue was first discussed nearly 4.5 years ago. Have there been any developments since then? My feeling is no, but it also sounds like there wasn't much traction for this enhancement either. My gut instinct is to close this issue.

What do you think?

@jbrockmendel
Copy link
Member

I think this is closed by #18226

@jorisvandenbossche
Copy link
Member

Indeed, thanks

@jorisvandenbossche jorisvandenbossche modified the milestones: Someday, 0.22.0 Nov 28, 2017
@jorisvandenbossche
Copy link
Member

Closed by #18226

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Frequency DateOffsets
Projects
None yet
Development

No branches or pull requests

6 participants