I have this nested json dictionary and I want to rename the key name 'Keys' with its equivalent value using Python. I wonder if this is possible?
Current - 'Keys': ['AWS Backup'] I want it to be - 'AWS Backup': ['AWS Backup']
Sample json dictionary {'TimePeriod': {'Start': '2022-11-28', 'End': '2022-11-29'}, 'Total': {}, 'Groups': [{'Keys': ['AWS Backup'], 'Metrics': {'UnblendedCost': {'Amount': '0.000000111', 'Unit': 'USD'}}}, {'Keys': ['AWS Direct Connect'], 'Metrics': {'UnblendedCost': {'Amount': '0.0000111', 'Unit': 'USD'}}}, {'Keys': ['AWS Key Management Service'], 'Metrics': {'UnblendedCost': {'Amount': '0.000000111', 'Unit': 'USD'}}}
Tried do flatten the json but after doing it still no luck. I'm not sure if I can do it using pandas dataframe also? Plan to save that json also in a csv file.