Skip to content

DOC: update the Period.daysinmonth docstring #20295

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

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions pandas/_libs/tslibs/period.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1275,6 +1275,25 @@ cdef class _Period(object):

@property
def daysinmonth(self):
"""
Get total days of month that a Period falls on.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would maybe rephrase this as "Get the total number of days of the month that the Period falls in"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure will update now . As I'm not good in making sentences thanks for guiding :) 👍


Returns
-------
int

See Also
--------
Period.days_in_month : Return the days of the month

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no blank line is needed here

Period.dayofyear : Return the day of the year

Examples
--------
>>> p = pd.Period("2018-03-11", freq='H')
>>> p.daysinmonth
31
"""
return self.days_in_month

@property
Expand Down