plydata.one_table_verbs.tail¶
-
class
plydata.one_table_verbs.
tail
(*args, **kwargs)[source]¶ Select the bottom n rows
- Parameters
Examples
>>> import pandas as pd >>> df = pd.DataFrame({ ... 'x': [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], ... 'y': list('aaaabbcddd') }) >>> df >> tail(2) x y 8 9 d 9 10 d
Grouped dataframe
>>> df >> group_by('y') >> tail(2) groups: ['y'] x y 0 3 a 1 4 a 2 5 b 3 6 b 4 7 c 5 9 d 6 10 d