J'ai une colonne de 50983 lignes. chaque ligne a une liste à l'intérieur de laquelle il y a deux dictionnaires ou plus. je veux faire tous les dictionnaires dans un seul dictionnaire. je veux mettre à jour cet id dans chaque dictionnaire. j'ai utilisé :
l=[{'id':'abc12vr'},{'createdAt': '2018-12-18T16:09:57.098Z',
'notes': 'Candidate initial submission.',
'createdBy': 'Steven Klinger'},
{'createdAt': '2018-12-18T23:14:09.415Z',
'notes': 'The Candidate Status has now been updated from <strong>CV Submitted</strong> and <strong>Feedback Pending</strong> to <strong>Client CV Review</strong> and <strong>Feedback Awaiting</strong>',
'createdBy': 'Matt'},
{'createdAt': '2019-01-22T16:04:46.958Z',
'notes': 'The Candidate Status has now been updated from <strong>Client CV Review</strong> and <strong>Feedback Awaiting</strong> to <strong>Client CV Review</strong> and <strong>Position on Hold</strong>',
'createdBy': 'Matt'},
{'createdAt': '2018-12-18T16:09:57.098Z',
'notes': 'Candidate initial submission.',
'createdBy': 'Steven Klinger'},
{'createdAt': '2018-12-18T23:14:09.415Z',
'notes': 'The Candidate Status has now been updated from <strong>CV Submitted</strong> and <strong>Feedback Pending</strong> to <strong>Client CV Review</strong> and <strong>Feedback Awaiting</strong>',
'createdBy': 'Matt'},
{'createdAt': '2019-01-22T16:04:46.958Z',
'notes': 'The Candidate Status has now been updated from <strong>Client CV Review</strong> and <strong>Feedback Awaiting</strong> to <strong>Client CV Review</strong> and <strong>Position on Hold</strong>',
'createdBy': 'Matt'}]
id_dict = [d for d in l if 'id' in d][0]
merge = [{**d,**id_dict} for d in l if 'id' not in d]
Mais je n'obtiens que la dernière rangée avec un seul dictionnaire, je voulais que chaque rangée