File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -2044,7 +2044,7 @@ cdef class _Period(PeriodMixin):
2044
2044
2045
2045
See Also
2046
2046
--------
2047
- period.month : Get the month of the year on the given Period.
2047
+ period.month : Get the month of the year for the given Period.
2048
2048
period.day : Return the day of the month the Period falls on.
2049
2049
2050
2050
Notes
@@ -2060,9 +2060,10 @@ cdef class _Period(PeriodMixin):
2060
2060
2023
2061
2061
2062
2062
Create a Period object for 01 January 2023 and get the year:
2063
+
2063
2064
>>> period = pd.Period(' 2023' , ' D' )
2064
- >>> period.year
2065
- 2023
2065
+ >>> period.year
2066
+ 2023
2066
2067
2067
2068
Get the year for a period representing a quarter:
2068
2069
@@ -2073,13 +2074,13 @@ cdef class _Period(PeriodMixin):
2073
2074
Handle a case where the Period object is empty , which results in `NaN`:
2074
2075
2075
2076
>>> period = pd.Period(' nan' , ' M' )
2076
- >>> period.month
2077
+ >>> period.year
2077
2078
nan
2078
2079
2079
2080
Period object with an invalid format:
2080
2081
2081
2082
>>> period = pd.Period(' invalid' , ' M' )
2082
- # Will raise an DateParseError
2083
+ # Will raise a DateParseError
2083
2084
"""
2084
2085
base = self ._dtype._dtype_code
2085
2086
return pyear(self.ordinal , base )
You can’t perform that action at this time.
0 commit comments