Split pandas dataframe based on values in a column using groupby June 29, 2023 by Tarik gb = df.groupby('ZZ') [gb.get_group(x) for x in gb.groups]