Skip to content
Advertisement

Get several dataframe from an original one

I have the following dataframe:

JavaScript

I need to get a number of dataframes for each category. For instance, as output for category A:

JavaScript

Advertisement

Answer

Let’s split the categories, explode the data frame and groupby:

JavaScript

And you get, for example df_dicts['A']:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement