Skip to content

Commit 033ba12

Browse files
committed
This reverts commit f52c610.
1 parent b966845 commit 033ba12

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pandas/_libs/tslibs/period.pyx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2044,7 +2044,7 @@ cdef class _Period(PeriodMixin):
20442044

20452045
See Also
20462046
--------
2047-
period.month : Get the month of the year for the given Period.
2047+
period.month : Get the month of the year on the given Period.
20482048
period.day : Return the day of the month the Period falls on.
20492049

20502050
Notes
@@ -2060,10 +2060,9 @@ cdef class _Period(PeriodMixin):
20602060
2023
20612061

20622062
Create a Period object for 01 January 2023 and get the year:
2063-
20642063
>>> period = pd.Period('2023', 'D')
2065-
>>> period.year
2066-
2023
2064+
        >>> period.year
2065+
        2023
20672066

20682067
Get the year for a period representing a quarter:
20692068

@@ -2074,13 +2073,13 @@ cdef class _Period(PeriodMixin):
20742073
Handle a case where the Period object is empty, which results in `NaN`:
20752074

20762075
>>> period = pd.Period('nan', 'M')
2077-
>>> period.year
2076+
>>> period.month
20782077
nan
20792078

20802079
Period object with an invalid format:
20812080

20822081
>>> period = pd.Period('invalid', 'M')
2083-
# Will raise a DateParseError
2082+
# Will raise an DateParseError
20842083
"""
20852084
base = self._dtype._dtype_code
20862085
return pyear(self.ordinal, base)

0 commit comments

Comments
 (0)