Skip to content
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

API: add is_beg_month/year, is_end_month/year accessors for a DateTimeIndex/Timestamp #4565

Closed
jreback opened this issue Aug 14, 2013 · 0 comments · Fixed by #4823
Closed
Labels
API Design Datetime Datetime data dtype Frequency DateOffsets
Milestone

Comments

@jreback
Copy link
Contributor

jreback commented Aug 14, 2013

In [110]: x = Timestamp('20130101')

Last day of month

In [111]: pd.tslib.monthrange(x.year,x.month)[1]==x.day
Out[111]: False

First day of month

In [112]: x.day==1
Out[112]: True

First day of year

In [113]: x.day==1 & x.month==1
Out[113]: True

http://stackoverflow.com/questions/18233107/pandas-convert-datetime-to-end-of-month/18233876?noredirect=1#comment26732170_18233876

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

Successfully merging a pull request may close this issue.

1 participant