From 2e06b25008ab1d675f16e0c3cd78774d053db583 Mon Sep 17 00:00:00 2001 From: HimanshuAwasthi95 Date: Mon, 12 Mar 2018 12:36:48 +0530 Subject: [PATCH 1/3] Add docstring for Period.daysinmonth --- pandas/_libs/tslibs/period.pyx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/pandas/_libs/tslibs/period.pyx b/pandas/_libs/tslibs/period.pyx index 89f38724cde1a..4c4dd6c43a055 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -1275,6 +1275,31 @@ cdef class _Period(object): @property def daysinmonth(self): + """ + Return total number of days of the month in given Period. + + This attribute returns the total number of days of given month + + Returns + ------- + Int + Number of days with in month + + See also + -------- + Period.dayofweek + Return the day of the week + + Period.dayofyear + Return the day of the year + + Examples + -------- + >>> import pandas as pd + >>> p = pd.Period("2018-03-11", freq='H') + >>> p.daysinmonth + 31 + """ return self.days_in_month @property From bd0254aed2fe777caed63af916dd24d820553488 Mon Sep 17 00:00:00 2001 From: HimanshuAwasthi95 Date: Mon, 12 Mar 2018 13:54:44 +0530 Subject: [PATCH 2/3] update changes --- pandas/_libs/tslibs/period.pyx | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/pandas/_libs/tslibs/period.pyx b/pandas/_libs/tslibs/period.pyx index 4c4dd6c43a055..f8df7fbc90816 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -1276,26 +1276,20 @@ cdef class _Period(object): @property def daysinmonth(self): """ - Return total number of days of the month in given Period. - - This attribute returns the total number of days of given month + Get total days of month that a Period falls on. Returns ------- - Int - Number of days with in month + int - See also + See Also -------- - Period.dayofweek - Return the day of the week + Period.days_in_month : Return the days of the month - Period.dayofyear - Return the day of the year + Period.dayofyear : Return the day of the year Examples -------- - >>> import pandas as pd >>> p = pd.Period("2018-03-11", freq='H') >>> p.daysinmonth 31 From c2e5c33d68d5b3baea0395a5e7bd2aee07f36594 Mon Sep 17 00:00:00 2001 From: HimanshuAwasthi95 Date: Mon, 12 Mar 2018 16:06:58 +0530 Subject: [PATCH 3/3] update required changes --- pandas/_libs/tslibs/period.pyx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/_libs/tslibs/period.pyx b/pandas/_libs/tslibs/period.pyx index f8df7fbc90816..c5829d1846f0a 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -1276,7 +1276,7 @@ cdef class _Period(object): @property def daysinmonth(self): """ - Get total days of month that a Period falls on. + Get the total number of days of the month that the Period falls in. Returns ------- @@ -1285,7 +1285,6 @@ cdef class _Period(object): See Also -------- Period.days_in_month : Return the days of the month - Period.dayofyear : Return the day of the year Examples