title: Merge and create a new JSON array of all the records with same id
body: <p>I have to merge and create a JSON array of all the records having same cluster_id within a list of dictionary. For example: id: 1 &amp; 2 has same cluster_id field so they should be merged as shown in expected output and 3 fields id,name,match_full_address should be shown as JSON array for the new field record and same for the singleton record with id 3.</p>
  
  <p>My Dictionary list:</p>
  
  <pre><code>[{
      'id': 1,
      'name': 'Will Smith',
      'match_full_address': 'Ridge Boulevard,123 Main Street,Branchburg,NJ',
      'cluster_id': 91,
      'lat': 18756.73,
      'longi': -97.395351,
  },
  {
      'id': 2,
      'name': 'Sandra Bullock',
      'match_full_address': 'New Castle,123 Mountain Ave,Branchburg,NJ',
      'cluster_id': 91,
      'lat': 18756.73,
      'longi': -97.395351,
  },
  {
      'id': 3,
      'name': 'Tom Cruise',
      'match_full_address': 'MI2, 123 Syracuse Avenue, Branchburg,NJ',
      'cluster_id': 92,
      'lat': 18756.73,
      'longi': -97.395351,
  }
  ]
  </code></pre>
  
  <p><strong>Expected Output</strong>:</p>
  
  <pre><code>[{
      'cluster_id': 91,
      'lat': 18756.73,
      'longi': -97.395351,
          'records': [{'id': 1,
      'name': 'Will Smith',
      'match_full_address': 'Ridge Boulevard,123 Main Street,Branchburg,NJ'},
      {'id': 2,
      'name': 'Sandra Bullock',
      'match_full_address': 'New Castle,123 Mountain Ave,Branchburg,NJ'}]
  },
  {
      'cluster_id': 92,
      'lat': 18756.73,
      'longi': -97.395351,
   'records': [{  'id': 3,
      'name': 'Tom Cruise',
      'match_full_address': 'MI2, 123 Syracuse Avenue, Branchburg,NJ'}
  }
  ]
  </code></pre>