I'm working with a music database and I have all the data transformed the way I want it to except I cannot yet figure out how to add another level of indexing to my dataframe. So far, I've grouped everything on genre and aggregated a few computations and that came out fine:
Now I'd like for my dataframe to look like this dataframe where the major_category
is genre
, the minor_category
is all the columns except duration
, and the values are the ones associated to the respective minor_category
:
Any help is much appreciated!