Skip to content

Commit 9929ec6

Browse files
committed
Fix docstrings ci error cython-lint
1 parent 02e911b commit 9929ec6

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

pandas/_libs/tslibs/period.pyx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,17 +1913,18 @@ cdef class _Period(PeriodMixin):
19131913
Parameters
19141914
----------
19151915
freq : str, BaseOffset
1916-
The target frequency to convert the Period object to. If a string is provided,
1916+
The target frequency to convert the Period object to.
1917+
If a string is provided,
19171918
it must be a valid :ref:`period alias <timeseries.period_aliases>`.
19181919

19191920
how : {'E', 'S', 'end', 'start'}, default 'end'
1920-
Specifies whether to align the converted period to the start or end of the interval:
1921+
Specifies whether to align the period to the start or end of the interval:
19211922
- 'E' or 'end': Align to the end of the interval.
19221923
- 'S' or 'start': Align to the start of the interval.
19231924

19241925
Returns
19251926
-------
1926-
Resampled Period : A new Period object with the specified frequency, aligned according to the `how` parameter.
1927+
Period : A new Period object with the specified frequency, aligned to the `how` parameter.
19271928

19281929
See Also
19291930
--------
@@ -1946,13 +1947,13 @@ cdef class _Period(PeriodMixin):
19461947
>>> period.asfreq('D', how='start')
19471948
Period('2023-01-01', 'D')
19481949

1949-
Convert a yearly period to a monthly period, aligning to the last month of the year:
1950+
Convert a yearly period to a monthly period, aligning to the last month:
19501951

19511952
>>> period = pd.Period('2023', freq='Y')
19521953
>>> period.asfreq('M', how='end')
19531954
Period('2023-12', 'M')
19541955

1955-
Convert a monthly period to an hourly period, aligning to the start of the first day of the month:
1956+
Convert a monthly period to an hourly period, aligning to the first day of the month:
19561957

19571958
>>> period = pd.Period('2023-01', freq='M')
19581959
>>> period.asfreq('h', how='start')
@@ -2067,7 +2068,7 @@ cdef class _Period(PeriodMixin):
20672068
Notes
20682069
-----
20692070
The month is determined based on the `ordinal` and `base` attributes of the Period.
2070-
2071+
20712072
Examples
20722073
--------
20732074
Create a Period object for January 2022 and get the month:
@@ -2076,7 +2077,7 @@ cdef class _Period(PeriodMixin):
20762077
>>> period.month
20772078
1
20782079

2079-
Create a Period object with no specified frequency, resulting in a default frequency:
2080+
Period object with no specified frequency, resulting in a default frequency:
20802081

20812082
>>> period = pd.Period('2022', 'Y')
20822083
>>> period.month
@@ -2088,7 +2089,7 @@ cdef class _Period(PeriodMixin):
20882089
>>> period.month
20892090
1
20902091

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

20932094
>>> period = pd.Period('nan', 'M')
20942095
>>> period.month

0 commit comments

Comments
 (0)