Split pandas dataframe based on values in a column using groupby

gb = df.groupby('ZZ')    
[gb.get_group(x) for x in gb.groups]

Leave a Comment