Some key points #
Suppose you have a DataFrame named as
df.groupby('param')will create multiple groups based on the parameter you provide.
Each group is a DataFrame.
For each group,
groupis the string of
groupis the group’s actual data in the form DataFrame.
How to get a specific group’s data #
dfGroupby = df.groupby('param') dfGroupby.get_group("GROUP_NAME")
How to print a groupby object #
Question is posted here: https://stackoverflow.com/questions/22691010/how-to-print-a-groupby-object
QPeiran provides a clever solution , which later is improved by set92:
Gajraj Singh Chouhan mentions that you need to import
Ipython.display, but I am not sure whether it’s necessary. I didn’t import it and didn’t experience any problem.
Last modified on 2023-01-18