Skip to content

Commit 85b4586

Browse files
DeaMariaLeonMarcoGorelli
authored andcommitted
DOC: Corrected code_checks.sh (pandas-dev#53266)
* Corrected code_checks.sh * Added example for Series.dt.end_time * Update pandas/_libs/tslibs/period.pyx --------- Co-authored-by: Marco Edward Gorelli <[email protected]>
1 parent 373918f commit 85b4586

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
169169
pandas.Timedelta.to_numpy \
170170
pandas.Timedelta.total_seconds \
171171
pandas.arrays.TimedeltaArray \
172-
pandas.Period.end_time \
173172
pandas.Period.freqstr \
174173
pandas.Period.is_leap_year \
175174
pandas.Period.month \

pandas/_libs/tslibs/period.pyx

+17
Original file line numberDiff line numberDiff line change
@@ -1664,8 +1664,25 @@ cdef class PeriodMixin:
16641664

16651665
Examples
16661666
--------
1667+
For Period:
1668+
16671669
>>> pd.Period('2020-01', 'D').end_time
16681670
Timestamp('2020-01-01 23:59:59.999999999')
1671+
1672+
For Series:
1673+
1674+
>>> period_index = pd.period_range('2020-1-1 00:00', '2020-3-1 00:00', freq='M')
1675+
>>> s = pd.Series(period_index)
1676+
>>> s
1677+
0 2020-01
1678+
1 2020-02
1679+
2 2020-03
1680+
dtype: period[M]
1681+
>>> s.dt.end_time
1682+
0 2020-01-31 23:59:59.999999999
1683+
1 2020-02-29 23:59:59.999999999
1684+
2 2020-03-31 23:59:59.999999999
1685+
dtype: datetime64[ns]
16691686
"""
16701687
return self.to_timestamp(how="end")
16711688

0 commit comments

Comments
 (0)