python – How to group keys in a list of list of dictionaries with the same keys?

I have a list of list of dictionaries like the below:

[[{'what-is-contributing-to-the-quarter-on-same-quarter-a-year-ago-decrease?': 'None'},
 {'main-points-': 'None'},
 {'things-you-need-to-know-about-this-release': 'None'},
 {'what-is-contributing-to-the-three-months-on-same-three-months-a-year-ago-decrease?': 'None'},
 {'blue-book-2019': 'None'},
 {'manufacturing': 'None'},
 {'production': 'None'},
 {'what-is-contributing-to-the-annual-increase?': 'None'},
 {'production-data': 'None'},
 {'external-influences-on-production': 'None'},
 {'main-points': 'Monthly production output fell by 0.2% between February and March 2022, reaching a level that was 1.6% below February 2020 - the last month of "normal" trading conditions prior to the coronavirus (COVID-19) pandemic.The monthly fall in output resulted from weakness in two of the four production sectors, with electricity and gas falling by 2.0% and manufacturing falling by 0.2%; in contrast mining and quarrying rose by 2.8%, while water supply and sewerage remained flat at 0.0%.Manufacturing saw 6 of the 13 sub-sectors negatively contribute to growth during March; most notably, manufacturing of basic pharmaceutical products fell by 5.4% and manufacturing of chemicals and chemical products fell by 3.5%.Output remained below the February 2020 pre-coronavirus levels in three of the four production sectors; monthly manufacturing output remained 1.0% below, mining and quarrying was 13.7% below, and electricity and gas was 6.0% below, while water supply and sewerage was 8.2% above.For Quarter 1 (Jan to Mar) 2022, production output increased by 1.2% compared with Quarter 4 (Oct to Dec) 2021; rises of 1.3% in manufacturing, 1.9% in electricity and gas and 0.4% in water supply and sewerage were partially offset by a fall of 0.2% in mining and quarrying.Manufacture of basic metals and metal products rose by 8.4% in Quarter 1 2022 compared with Quarter 4 2021, mainly because of strength from the fabricated metal products excluding the weapons and ammunition industry.Further analysis of the effect on our monthly Index of Production estimate is available in our GDP monthly estimate, UK: March 2022 bulletin, published 12 May 2022.Back to table of contents'},
 {'what-is-contributing-to-the-three-month-on-same-three-month-a-year-ago-decrease?': 'None'},
 {'production-in-detail': 'None'},
 {'mining-and-quarrying': 'None'},
 {'electricity-and-gas': 'None'},
 {'what-is-contributing-to-the-month-on-previous-month-decrease?': 'None'},
 {'quality-and-methodology': 'None'},
 {'water-and-waste': 'None'},
 {'index-of-production-data': "Index of Production (IoP) time series Dataset DIOP | Released 12 May 2022 Movements in the volume of production for the UK production industries: manufacturing, mining and quarrying, energy supply, and water and waste management. Figures are seasonally adjusted.Output of the production industries Dataset | Released 12 May 2022 Index values and growth rates for production, manufacturing and the main industrial groupings in the UK.Index of Production and industry sectors to four decimal places Dataset | Released 12 May 2022 Monthly index values for production and the main IoP sectors in the UK to four decimal places.Monthly Business Survey turnover in production industries Dataset | Released 12 May 2022 Monthly Business Survey (MBS) production industries' total turnover, domestic sales and exports in the UK. Figures are in current price and non-seasonally adjusted.Export proportions for manufacturing industries Dataset | Released 12 May 2022 Monthly, three-monthly, and annual export data for the manufacturing industries, collected by the MBS at industry level in the UK.All data related to the IoP are available onxa0our Related data page. Back to table of contents"},
 {'what-is-contributing-to-the-month-on-previous-month-increase?': 'None'},
 {'what-is-contributing-to-the-three-monthly-decrease?': 'None'},
 {'what-is-contributing-to-the-quarterly-decrease?': 'None'},
 {'what-is-contributing-to-the-quarter-on-previous-quarter-increase?': 'None'},
 {'what-is-contributing-to-the-quarter-on-same-quarter-a-year-ago-increase?': 'None'},
 {'strengths-and-limitations': 'None'},
 {'what-is-contributing-to-the-three-months-on-same-three-months-a-year-ago-increase?': 'None'},
 {'what-is-contributing-to-the-three-monthly-increase?': 'None'}]

[{'what-is-contributing-to-the-quarter-on-same-quarter-a-year-ago-decrease?': 'None'},
 {'main-points-': 'None'},
 {'things-you-need-to-know-about-this-release': 'None'},
 {'what-is-contributing-to-the-three-months-on-same-three-months-a-year-ago-decrease?': 'None'},
 {'blue-book-2019': 'None'},
 {'manufacturing': 'None'},
 {'production': 'None'},
 {'what-is-contributing-to-the-annual-increase?': 'None'},
 {'production-data': 'None'},
 {'external-influences-on-production': 'None'},
 {'main-points': 'Monthly production output fell by 0.2% between February and March 2022, reaching a level that was 1.6% below February 2020 - the last month of "normal" trading conditions prior to the coronavirus (COVID-19) pandemic.The monthly fall in output resulted from weakness in two of the four production sectors, with electricity and gas falling by 2.0% and manufacturing falling by 0.2%; in contrast mining and quarrying rose by 2.8%, while water supply and sewerage remained flat at 0.0%.Manufacturing saw 6 of the 13 sub-sectors negatively contribute to growth during March; most notably, manufacturing of basic pharmaceutical products fell by 5.4% and manufacturing of chemicals and chemical products fell by 3.5%.Output remained below the February 2020 pre-coronavirus levels in three of the four production sectors; monthly manufacturing output remained 1.0% below, mining and quarrying was 13.7% below, and electricity and gas was 6.0% below, while water supply and sewerage was 8.2% above.For Quarter 1 (Jan to Mar) 2022, production output increased by 1.2% compared with Quarter 4 (Oct to Dec) 2021; rises of 1.3% in manufacturing, 1.9% in electricity and gas and 0.4% in water supply and sewerage were partially offset by a fall of 0.2% in mining and quarrying.Manufacture of basic metals and metal products rose by 8.4% in Quarter 1 2022 compared with Quarter 4 2021, mainly because of strength from the fabricated metal products excluding the weapons and ammunition industry.Further analysis of the effect on our monthly Index of Production estimate is available in our GDP monthly estimate, UK: March 2022 bulletin, published 12 May 2022.Back to table of contents'},
 {'what-is-contributing-to-the-three-month-on-same-three-month-a-year-ago-decrease?': 'None'},
 {'production-in-detail': 'None'},
 {'mining-and-quarrying': 'None'},
 {'electricity-and-gas': 'None'},
 {'what-is-contributing-to-the-month-on-previous-month-decrease?': 'None'},
 {'quality-and-methodology': 'None'},
 {'water-and-waste': 'None'},
 {'index-of-production-data': "Index of Production (IoP) time series Dataset DIOP | Released 12 May 2022 Movements in the volume of production for the UK production industries: manufacturing, mining and quarrying, energy supply, and water and waste management. Figures are seasonally adjusted.Output of the production industries Dataset | Released 12 May 2022 Index values and growth rates for production, manufacturing and the main industrial groupings in the UK.Index of Production and industry sectors to four decimal places Dataset | Released 12 May 2022 Monthly index values for production and the main IoP sectors in the UK to four decimal places.Monthly Business Survey turnover in production industries Dataset | Released 12 May 2022 Monthly Business Survey (MBS) production industries' total turnover, domestic sales and exports in the UK. Figures are in current price and non-seasonally adjusted.Export proportions for manufacturing industries Dataset | Released 12 May 2022 Monthly, three-monthly, and annual export data for the manufacturing industries, collected by the MBS at industry level in the UK.All data related to the IoP are available onxa0our Related data page. Back to table of contents"},
 {'what-is-contributing-to-the-month-on-previous-month-increase?': 'None'},
 {'what-is-contributing-to-the-three-monthly-decrease?': 'None'},
 {'what-is-contributing-to-the-quarterly-decrease?': 'None'},
 {'what-is-contributing-to-the-quarter-on-previous-quarter-increase?': 'None'},
 {'what-is-contributing-to-the-quarter-on-same-quarter-a-year-ago-increase?': 'None'},
 {'strengths-and-limitations': 'None'},
 {'what-is-contributing-to-the-three-months-on-same-three-months-a-year-ago-increase?': 'None'},
 {'what-is-contributing-to-the-three-monthly-increase?': 'None'}]

...

[{'what-is-contributing-to-the-quarter-on-same-quarter-a-year-ago-decrease?': 'None'},
 {'main-points-': 'None'},
 {'things-you-need-to-know-about-this-release': 'None'},
 {'what-is-contributing-to-the-three-months-on-same-three-months-a-year-ago-decrease?': 'None'},
 {'blue-book-2019': 'None'},
 {'manufacturing': 'None'},
 {'production': 'None'},
 {'what-is-contributing-to-the-annual-increase?': 'None'},
 {'production-data': 'None'},
 {'external-influences-on-production': 'None'},
 {'main-points': 'Monthly production output fell by 0.2% between February and March 2022, reaching a level that was 1.6% below February 2020 - the last month of "normal" trading conditions prior to the coronavirus (COVID-19) pandemic.The monthly fall in output resulted from weakness in two of the four production sectors, with electricity and gas falling by 2.0% and manufacturing falling by 0.2%; in contrast mining and quarrying rose by 2.8%, while water supply and sewerage remained flat at 0.0%.Manufacturing saw 6 of the 13 sub-sectors negatively contribute to growth during March; most notably, manufacturing of basic pharmaceutical products fell by 5.4% and manufacturing of chemicals and chemical products fell by 3.5%.Output remained below the February 2020 pre-coronavirus levels in three of the four production sectors; monthly manufacturing output remained 1.0% below, mining and quarrying was 13.7% below, and electricity and gas was 6.0% below, while water supply and sewerage was 8.2% above.For Quarter 1 (Jan to Mar) 2022, production output increased by 1.2% compared with Quarter 4 (Oct to Dec) 2021; rises of 1.3% in manufacturing, 1.9% in electricity and gas and 0.4% in water supply and sewerage were partially offset by a fall of 0.2% in mining and quarrying.Manufacture of basic metals and metal products rose by 8.4% in Quarter 1 2022 compared with Quarter 4 2021, mainly because of strength from the fabricated metal products excluding the weapons and ammunition industry.Further analysis of the effect on our monthly Index of Production estimate is available in our GDP monthly estimate, UK: March 2022 bulletin, published 12 May 2022.Back to table of contents'},
 {'what-is-contributing-to-the-three-month-on-same-three-month-a-year-ago-decrease?': 'None'},
 {'production-in-detail': 'None'},
 {'mining-and-quarrying': 'None'},
 {'electricity-and-gas': 'None'},
 {'what-is-contributing-to-the-month-on-previous-month-decrease?': 'None'},
 {'quality-and-methodology': 'None'},
 {'water-and-waste': 'None'},
 {'index-of-production-data': "Index of Production (IoP) time series Dataset DIOP | Released 12 May 2022 Movements in the volume of production for the UK production industries: manufacturing, mining and quarrying, energy supply, and water and waste management. Figures are seasonally adjusted.Output of the production industries Dataset | Released 12 May 2022 Index values and growth rates for production, manufacturing and the main industrial groupings in the UK.Index of Production and industry sectors to four decimal places Dataset | Released 12 May 2022 Monthly index values for production and the main IoP sectors in the UK to four decimal places.Monthly Business Survey turnover in production industries Dataset | Released 12 May 2022 Monthly Business Survey (MBS) production industries' total turnover, domestic sales and exports in the UK. Figures are in current price and non-seasonally adjusted.Export proportions for manufacturing industries Dataset | Released 12 May 2022 Monthly, three-monthly, and annual export data for the manufacturing industries, collected by the MBS at industry level in the UK.All data related to the IoP are available onxa0our Related data page. Back to table of contents"},
 {'what-is-contributing-to-the-month-on-previous-month-increase?': 'None'},
 {'what-is-contributing-to-the-three-monthly-decrease?': 'None'},
 {'what-is-contributing-to-the-quarterly-decrease?': 'None'},
 {'what-is-contributing-to-the-quarter-on-previous-quarter-increase?': 'None'},
 {'what-is-contributing-to-the-quarter-on-same-quarter-a-year-ago-increase?': 'None'},
 {'strengths-and-limitations': 'None'},
 {'what-is-contributing-to-the-three-months-on-same-three-months-a-year-ago-increase?': 'None'},
 {'what-is-contributing-to-the-three-monthly-increase?': 'None'}]]

There are a total of 27 lists inside the parent list. The issue is the keys are all the same in each list and I would like to group all the keys under the same list in the same parent list. How would I go about doing this?

So instead of the above, I would have something like:

[[{'what-is-contributing-to-the-quarter-on-same-quarter-a-year-ago-decrease?': 'None'},
  {'what-is-contributing-to-the-quarter-on-same-quarter-a-year-ago-decrease?': 'None'},
  {'what-is-contributing-to-the-quarter-on-same-quarter-a-year-ago-decrease?': 'None'},
  {'what-is-contributing-to-the-quarter-on-same-quarter-a-year-ago-decrease?': 'None'},
  {'what-is-contributing-to-the-quarter-on-same-quarter-a-year-ago-decrease?': 'None'},
  {'what-is-contributing-to-the-quarter-on-same-quarter-a-year-ago-decrease?': 'None'},
  {'what-is-contributing-to-the-quarter-on-same-quarter-a-year-ago-decrease?': 'None'}],
 [{'main-points-': 'None'},
  {'main-points-': 'None'},
  {'main-points-': 'None'},
  {'main-points-': 'None'},
  {'main-points-': 'None'},
  {'main-points-': 'None'},
  {'main-points-': 'None'}]]

Leave a Comment