I have the following list of dictionaries:
[
{"id": 1, "roll_id": ["101", "201"]},
{"id": 2, "roll_id": ["301", "201"]},
{"id": 3, "roll_id": ["424"]}
]
Now I need to convert this into the following format:
[
{'roll_id': '101', 'id':["1"]},
{'roll_id': '201', 'id':["1","2"]},
{'roll_id': '301', 'id':["2"]},
{'roll_id': '424', 'id':["3"]}
]
Can anyone help me, please?