in my Python script I'm initializing a dictionary which will be managed afterwards as a nested dictionary. After updating and working with it I want to save it as a csv file as a permanent storage so I can read it in again later and then update again and so on.
My problem is the following. For working with the nested dictionary it has the following structure:
dict = {
'key1': {
'grp1': 0,
'grp2': 2
}
}
Using pandas I can perfectly export this as a csv file using data = pd.DataFrame(dict)
which I can then use as a table in Libre Calc or Excel where it looks like this:
key | |
---|---|
grp1 | 2 |
grp2 | 4 |