Skip to content

Commit bec5226

Browse files
Backport PR pandas-dev#56222 on branch 2.1.x (Add doc notes for deprecations) (pandas-dev#56225)
Backport PR pandas-dev#56222: Add doc notes for deprecations Co-authored-by: Patrick Hoefler <[email protected]>
1 parent 2d812e2 commit bec5226

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

pandas/core/generic.py

+8
Original file line numberDiff line numberDiff line change
@@ -9456,6 +9456,10 @@ def first(self, offset) -> Self:
94569456
"""
94579457
Select initial periods of time series data based on a date offset.
94589458
9459+
.. deprecated:: 2.1
9460+
:meth:`.first` is deprecated and will be removed in a future version.
9461+
Please create a mask and filter using `.loc` instead.
9462+
94599463
For a DataFrame with a sorted DatetimeIndex, this function can
94609464
select the first few rows based on a date offset.
94619465
@@ -9535,6 +9539,10 @@ def last(self, offset) -> Self:
95359539
"""
95369540
Select final periods of time series data based on a date offset.
95379541
9542+
.. deprecated:: 2.1
9543+
:meth:`.last` is deprecated and will be removed in a future version.
9544+
Please create a mask and filter using `.loc` instead.
9545+
95389546
For a DataFrame with a sorted DatetimeIndex, this function
95399547
selects the last few rows based on a date offset.
95409548

0 commit comments

Comments
 (0)