Skip to content

Commit 66e4517

Browse files
DOC: Fix Error in pandas.Series.last (#33199)
1 parent 9f8d844 commit 66e4517

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pandas/core/generic.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -8062,15 +8062,21 @@ def first(self: FrameOrSeries, offset) -> FrameOrSeries:
80628062

80638063
def last(self: FrameOrSeries, offset) -> FrameOrSeries:
80648064
"""
8065-
Method to subset final periods of time series data based on a date offset.
8065+
Select final periods of time series data based on a date offset.
8066+
8067+
When having a DataFrame with dates as index, this function can
8068+
select the last few rows based on a date offset.
80668069
80678070
Parameters
80688071
----------
80698072
offset : str, DateOffset, dateutil.relativedelta
8073+
The offset length of the data that will be selected. For instance,
8074+
'3D' will display all the rows having their index within the last 3 days.
80708075
80718076
Returns
80728077
-------
8073-
subset : same type as caller
8078+
Series or DataFrame
8079+
A subset of the caller.
80748080
80758081
Raises
80768082
------

0 commit comments

Comments
 (0)