Skip to content

Commit 392f78a

Browse files
committed
Fix docstrings for pandas.Period.month indentation
1 parent 6cb9f52 commit 392f78a

File tree

1 file changed

+39
-39
lines changed

1 file changed

+39
-39
lines changed

pandas/_libs/tslibs/period.pyx

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,60 +2011,60 @@ cdef class _Period(PeriodMixin):
20112011

20122012
@property
20132013
def month(self) -> int:
2014-
"""
2015-
Return the month this Period falls on.
2014+
"""
2015+
Return the month this Period falls on.
20162016

2017-
Parameters
2018-
----------
2019-
None
2017+
Parameters
2018+
----------
2019+
None
20202020

2021-
Returns
2022-
-------
2023-
int : The month number of the Period.
2021+
Returns
2022+
-------
2023+
int : The month number of the Period.
20242024

2025-
See Also
2026-
--------
2027-
period.week : Get the week of the year on the given Period.
2028-
Period.year : Return the year this Period falls on.
2029-
Period.day : Return the day of the month this Period falls on.
2025+
See Also
2026+
--------
2027+
period.week : Get the week of the year on the given Period.
2028+
Period.year : Return the year this Period falls on.
2029+
Period.day : Return the day of the month this Period falls on.
20302030

20312031

2032-
Examples
2033-
--------
2034-
Create a Period object for January 2022 and get the month:
2032+
Examples
2033+
--------
2034+
Create a Period object for January 2022 and get the month:
20352035

2036-
>>> period = pd.Period('2022-01', 'M')
2037-
>>> period.month
2038-
1
2036+
>>> period = pd.Period('2022-01', 'M')
2037+
>>> period.month
2038+
1
20392039

2040-
Create a Period object with no specified frequency, resulting in a default frequency:
2040+
Create a Period object with no specified frequency, resulting in a default frequency:
20412041

2042-
>>> period = pd.Period('2022', 'Y')
2043-
>>> period.month
2044-
12
2042+
>>> period = pd.Period('2022', 'Y')
2043+
>>> period.month
2044+
12
20452045

2046-
Create a Period object with a specified frequency but an incomplete date string:
2046+
Create a Period object with a specified frequency but an incomplete date string:
20472047

2048-
>>> period = pd.Period('2022', 'M')
2049-
>>> period.month
2050-
1
2048+
>>> period = pd.Period('2022', 'M')
2049+
>>> period.month
2050+
1
20512051

2052-
Handle a case where the Period object is invalid or empty, which results in `NaN`:
2052+
Handle a case where the Period object is invalid or empty, which results in `NaN`:
20532053

2054-
>>> period = pd.Period('nan', 'M')
2055-
>>> period.month
2056-
nan
2054+
>>> period = pd.Period('nan', 'M')
2055+
>>> period.month
2056+
nan
20572057

2058-
Handle a case where the Period object is invalid or empty, which results in `NaN`:
2058+
Handle a case where the Period object is invalid or empty, which results in `NaN`:
20592059

2060-
>>> period = pd.Period('nan', 'M')
2061-
>>> period.month
2062-
nan
2060+
>>> period = pd.Period('nan', 'M')
2061+
>>> period.month
2062+
nan
20632063

2064-
Notes
2065-
-----
2066-
The month is determined based on the `ordinal` and `base` attributes of the Period.
2067-
"""
2064+
Notes
2065+
-----
2066+
The month is determined based on the `ordinal` and `base` attributes of the Period.
2067+
"""
20682068

20692069
base = self._dtype._dtype_code
20702070
return pmonth(self.ordinal, base)

0 commit comments

Comments
 (0)