plydata.one_table_verbs.head¶
-
class
plydata.one_table_verbs.
head
(*args, **kwargs)[source]¶ Select the top 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 >> head(2) x y 0 1 a 1 2 a
Grouped dataframe
>>> df >> group_by('y') >> head(2) groups: ['y'] x y 0 1 a 1 2 a 2 5 b 3 6 b 4 7 c 5 8 d 6 9 d