I want to create a hierarchical dictionary from the dataframe in the image with four columns Total--> Type--> Item-->Region. How can i do that?
The result that i want is similar to the hierarchy image below. As you can see the image has three levels (Total -- > State -- > City) but in my data set that i attach there are four levels.
Thanks