diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 6436556e0a696..6918da60af52d 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -169,7 +169,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then pandas.Timedelta.to_numpy \ pandas.Timedelta.total_seconds \ pandas.arrays.TimedeltaArray \ - pandas.Period.end_time \ pandas.Period.freqstr \ pandas.Period.is_leap_year \ pandas.Period.month \ diff --git a/pandas/_libs/tslibs/period.pyx b/pandas/_libs/tslibs/period.pyx index 1626d1490b440..0c19dc4e2ec0a 100644 --- a/pandas/_libs/tslibs/period.pyx +++ b/pandas/_libs/tslibs/period.pyx @@ -1664,8 +1664,25 @@ cdef class PeriodMixin: Examples -------- + For Period: + >>> pd.Period('2020-01', 'D').end_time Timestamp('2020-01-01 23:59:59.999999999') + + For Series: + + >>> period_index = pd.period_range('2020-1-1 00:00', '2020-3-1 00:00', freq='M') + >>> s = pd.Series(period_index) + >>> s + 0 2020-01 + 1 2020-02 + 2 2020-03 + dtype: period[M] + >>> s.dt.end_time + 0 2020-01-31 23:59:59.999999999 + 1 2020-02-29 23:59:59.999999999 + 2 2020-03-31 23:59:59.999999999 + dtype: datetime64[ns] """ return self.to_timestamp(how="end")