modin.pandas.DataFrameGroupBy.tail¶
- DataFrameGroupBy.tail(n=5)[source]¶
Return last n rows of each group.
Similar to
.apply(lambda x: x.tail(n)), but it returns a subset of rows from the original DataFrame with original index and order preserved (as_indexflag is ignored).- Parameters:
n (int) – If positive: number of entries to include from the end of each group. If negative: number of entries to exclude from the start of each group.
- Returns:
Subset of the original Series or DataFrame as determined by n.
- Return type:
See also
Series.groupbyApply a function groupby to a Series.
DataFrame.groupbyApply a function groupby to each row or column of a DataFrame.
Examples