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 & 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.

My Dictionary list:

```
[{
    '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,
}
]

```

**Expected Output**:

```
[{
    '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'}
}
]

```