Skip to content
Advertisement

Pandas Dataframe into nested Dictionaries conversion in Python

I need a little help. I want to convert from dataframe into nested dictionaries.

JavaScript

and i want to convert in this format:

JavaScript

Advertisement

Answer

We can do groupby with agg dict items

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