From eef375c54d641b555c2dca659150eafb86de5975 Mon Sep 17 00:00:00 2001 From: Hammad Mashkoor Date: Sun, 11 Mar 2018 16:43:56 +0530 Subject: [PATCH 1/5] Added Doctring for Period dayofweek --- pandas/_libs/tslibs/period.pyx | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/pandas/_libs/tslibs/period.pyx b/pandas/_libs/tslibs/period.pyx index 89f38724cde1a..0706669282e14 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -1246,6 +1246,37 @@ cdef class _Period(object): @property def dayofweek(self): + """ + Return the day of the week. + + This attribute returns the day of the week on which the particular + date occurs with Monady=0, Sunday=6. + + Returns + ------- + Int:Range of 0 to 6 + + See also + -------- + Period.dayofyear + Return the day of year. + Period.daysinmonth + Return the days in that month. + + Examples + -------- + >>> p=pd.Period('2012-1-1 19:00', freq='H') + >>> p + Period('2012-01-01 19:00', 'H') + >>> p.dayofweek + 6 + + >>> q=pd.Period('2013-1-9 11:00', freq='H') + >>> q + Period('2013-01-09 11:00', 'H') + >>> q.dayofweek + 2 + """ base, mult = get_freq_code(self.freq) return pweekday(self.ordinal, base) From 952be06adbded7d718351f2c4474763f251fa38a Mon Sep 17 00:00:00 2001 From: Hammad Mashkoor Date: Sun, 11 Mar 2018 18:45:52 +0530 Subject: [PATCH 2/5] Updated Doctring for Period dayofweek --- pandas/_libs/tslibs/period.pyx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pandas/_libs/tslibs/period.pyx b/pandas/_libs/tslibs/period.pyx index 0706669282e14..7df66ede4342f 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -1250,11 +1250,12 @@ cdef class _Period(object): Return the day of the week. This attribute returns the day of the week on which the particular - date occurs with Monady=0, Sunday=6. + starting date for the given period occurs with Monday=0, Sunday=6. Returns ------- - Int:Range of 0 to 6 + Int + Range of 0 to 6 See also -------- @@ -1265,16 +1266,16 @@ cdef class _Period(object): Examples -------- - >>> p=pd.Period('2012-1-1 19:00', freq='H') - >>> p + >>> period1 = pd.Period('2012-1-1 19:00', freq='H') + >>> period1 Period('2012-01-01 19:00', 'H') - >>> p.dayofweek + >>> period1.dayofweek 6 - >>> q=pd.Period('2013-1-9 11:00', freq='H') - >>> q + >>> period2 = pd.Period('2013-1-9 11:00', freq='H') + >>> period2 Period('2013-01-09 11:00', 'H') - >>> q.dayofweek + >>> period2.dayofweek 2 """ base, mult = get_freq_code(self.freq) From 3e25a7e1ca41df6e840b5b8351c489793fbe21e4 Mon Sep 17 00:00:00 2001 From: Hammad Mashkoor Date: Mon, 12 Mar 2018 15:20:45 +0530 Subject: [PATCH 3/5] Updated Doctring for Period dayofweek --- pandas/_libs/tslibs/period.pyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/_libs/tslibs/period.pyx b/pandas/_libs/tslibs/period.pyx index 7df66ede4342f..e8f449f391194 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -1255,7 +1255,7 @@ cdef class _Period(object): Returns ------- Int - Range of 0 to 6 + Range from 0 to 6(included). See also -------- From 8072b211f402cbccd303b45cd28b8949d301c673 Mon Sep 17 00:00:00 2001 From: Hammad Mashkoor Date: Tue, 13 Mar 2018 14:49:34 +0530 Subject: [PATCH 4/5] Updated Docstring for perioddayofweek --- pandas/_libs/tslibs/period.pyx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pandas/_libs/tslibs/period.pyx b/pandas/_libs/tslibs/period.pyx index e8f449f391194..803bc78ea75ff 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -1250,19 +1250,18 @@ cdef class _Period(object): Return the day of the week. This attribute returns the day of the week on which the particular - starting date for the given period occurs with Monday=0, Sunday=6. + date for the given period occurs depending on the frequency with + Monday=0, Sunday=6. Returns ------- Int - Range from 0 to 6(included). + Range from 0 to 6 (included). See also -------- - Period.dayofyear - Return the day of year. - Period.daysinmonth - Return the days in that month. + Period.dayofyear : Return the day of year. + Period.daysinmonth : Return the days in that month. Examples -------- From de15589930feadfc8d25e992826876ddd853e91a Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Tue, 13 Mar 2018 11:04:38 +0100 Subject: [PATCH 5/5] Update period.pyx --- pandas/_libs/tslibs/period.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/_libs/tslibs/period.pyx b/pandas/_libs/tslibs/period.pyx index 803bc78ea75ff..e84642b4a8f2c 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -1260,8 +1260,8 @@ cdef class _Period(object): See also -------- - Period.dayofyear : Return the day of year. - Period.daysinmonth : Return the days in that month. + Period.dayofyear : Return the day of the year. + Period.daysinmonth : Return the number of days in that month. Examples --------