Skip to content

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

Closed
@jreback

Description

@jreback
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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions