DEV Community

J E E N A R J U N
J E E N A R J U N

Posted on

How to create a nested dictionary from existing list of dictionaries

I already have a dictionary as follows:

[{ 
  'acct': '2020', 
  'date': '2020-04-13', 
  'amount': 70.0, 
 },
{ 
  'acct': '2020', 
  'date': '2020-04-13', 
  'amount': 30.0, 
 },
{ 
  'acct': '2020', 
  'date': '2020-04-10', 
  'amount': 70.0, 
 },
{ 
  'acct': '2019', 
  'date': '2020-04-10', 
  'amount': 50.0, 
 }]

I want to create a new nested dictionary → whose initial…

Top comments (0)