I'm trying to merge the rows having dictionary inside the pandas data frame in single row. The output should have latest key values of that columns with all the keys
here is the input dataframe
df = pd.DataFrame([[{'a': 1, 'c': 2}, {'a': 3, 'b': 4}], [{'a': 5, 'b': 6}, {'a': 7, 'b': 8}]], columns=list('AB'))
A B
0 {'a': 1, 'c': 2} {'a': 3, 'b': 4}
1 {'a': 5, 'b': 6} {'a': 7, 'b': 8}
expected
A B
0 {'a': 5, 'b': 6, 'c': 2} {'a': 7, 'b': 8}
Thanks