GroupBy.
get_group
Construct DataFrame from group with provided name.
The name of the group to get as a DataFrame.
Examples
>>> psdf = ps.DataFrame([('falcon', 'bird', 389.0), ... ('parrot', 'bird', 24.0), ... ('lion', 'mammal', 80.5), ... ('monkey', 'mammal', np.nan)], ... columns=['name', 'class', 'max_speed'], ... index=[0, 2, 3, 1]) >>> psdf name class max_speed 0 falcon bird 389.0 2 parrot bird 24.0 3 lion mammal 80.5 1 monkey mammal NaN
>>> psdf.groupby("class").get_group("bird").sort_index() name class max_speed 0 falcon bird 389.0 2 parrot bird 24.0
>>> psdf.groupby("class").get_group("mammal").sort_index() name class max_speed 1 monkey mammal NaN 3 lion mammal 80.5