Skip to content

Commit 02e911b

Browse files
committed
Fix docstrings for pandas.Period.asfreq
1 parent 5918722 commit 02e911b

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

pandas/_libs/tslibs/period.pyx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,7 +1963,6 @@ cdef class _Period(PeriodMixin):
19631963
>>> period = pd.Period('2023-08-01', freq='W')
19641964
>>> period.asfreq('D', how='end')
19651965
Period('2023-08-04', 'D')
1966-
19671966
"""
19681967
freq = self._maybe_convert_freq(freq)
19691968
how = validate_end_alias(how)
@@ -2065,7 +2064,10 @@ cdef class _Period(PeriodMixin):
20652064
Period.year : Return the year this Period falls on.
20662065
Period.day : Return the day of the month this Period falls on.
20672066

2068-
2067+
Notes
2068+
-----
2069+
The month is determined based on the `ordinal` and `base` attributes of the Period.
2070+
20692071
Examples
20702072
--------
20712073
Create a Period object for January 2022 and get the month:
@@ -2091,12 +2093,7 @@ cdef class _Period(PeriodMixin):
20912093
>>> period = pd.Period('nan', 'M')
20922094
>>> period.month
20932095
nan
2094-
2095-
Notes
2096-
-----
2097-
The month is determined based on the `ordinal` and `base` attributes of the Period.
20982096
"""
2099-
21002097
base = self._dtype._dtype_code
21012098
return pmonth(self.ordinal, base)
21022099

0 commit comments

Comments
 (0)