Skip to content

Commit 788da7f

Browse files
aflah02luckyvs1
authored andcommitted
Added Documentation to specify that DataFrame.last() needs the index to be sorted to deliver the expected results (pandas-dev#38536)
* Update generic.py Added Documentation mentioning that DataFrame.last() needs the index to be sorted to deliver the expected results * Update generic.py Fixed PEP8 Issues * Update generic.py Fixed PEP 8 Issues * Update generic.py As per recommendation changed the description for DataFrame.last() making it more concise * Update generic.py Removed trailing whitespace to fix PEP 8 Issues
1 parent 0706d58 commit 788da7f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pandas/core/generic.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -8439,8 +8439,8 @@ def last(self: FrameOrSeries, offset) -> FrameOrSeries:
84398439
"""
84408440
Select final periods of time series data based on a date offset.
84418441
8442-
When having a DataFrame with dates as index, this function can
8443-
select the last few rows based on a date offset.
8442+
For a DataFrame with a sorted DatetimeIndex, this function
8443+
selects the last few rows based on a date offset.
84448444
84458445
Parameters
84468446
----------

0 commit comments

Comments
 (0)