I have a list of single dicts:
foo = [
{'A': 'a1'}, {'B': 'b1'},{'C': 'c1'},
{'A': 'a2'}, {'B': 'b2'}, {'C': 'c2'},
{'A': 'a3'}, {'B': 'b3'},{'C': 'c3'}
]
I want to build a DataFrame like this.
I tried this solution to group this list of dictionaries into a single dictionary Combine values of same keys in a list of dicts
bar = {
k: [d.get(k) for d in foo]
for k in set().union(*foo)
}
pd.DataFrame(bar)
But the output does not look good.
Can anyone help on this?