From 1c6b3e83a0e19f5e55f916435660a4307ca46f5c Mon Sep 17 00:00:00 2001 From: HimanshuAwasthi95 Date: Tue, 13 Mar 2018 08:25:58 +0530 Subject: [PATCH 1/2] Update the Period.second docstring --- pandas/_libs/tslibs/period.pyx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pandas/_libs/tslibs/period.pyx b/pandas/_libs/tslibs/period.pyx index eda0a8492ad24..84614ec1dd72f 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -1295,6 +1295,25 @@ cdef class _Period(object): @property def second(self): + """ + Get second of the minute component of the Period. + + Returns + ------- + int + The second as an integer, between 0 and 59. + + See Also + -------- + Period.hour : Get the hour component of the Period. + Period.minute : Get the minute component of the Period. + + Examples + -------- + >>> p = pd.Period("2018-03-11 13:03:12.050000") + >>> p.second + 12 + """ base, mult = get_freq_code(self.freq) return psecond(self.ordinal, base) From 2188f80c1ddc71a0d9601bec66e8ab0934626d4c Mon Sep 17 00:00:00 2001 From: HimanshuAwasthi95 Date: Tue, 13 Mar 2018 12:00:29 +0530 Subject: [PATCH 2/2] UPdate required change --- 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 84614ec1dd72f..1c543eed41d83 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -1296,12 +1296,12 @@ cdef class _Period(object): @property def second(self): """ - Get second of the minute component of the Period. + Get the second component of the Period. Returns ------- int - The second as an integer, between 0 and 59. + The second of the Period (ranges from 0 to 59). See Also --------