I have a list of dictionaries as shown below:
result = [
{'so': 'SO1', 'amt':250},
{'so': 'SO2', 'amt':200},
{'so': 'SO1', 'amt':100}
]
I need to merge it so that the result would be:
result = [
{'so': 'SO1', 'amt':350},
{'so': 'SO2', 'amt':200}
]
that is the dictionaries with same SO
are merged and their amt
is added.