I want to group a dataframe by a column, called 'A', and inspect certain certain group.
grouped = df.groupby('A', sort=False)
However, I don't know how to access a group, for example, I expect that
grouped.first()
would give me the first group
Or
grouped['foo']
would give me the group A=='foo'.
However, Pandas doesn't work like that.
I couldn't find a similar example online.
Try: grouped.get_group('foo')
, that is what you need.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments