1
I have two spreadsheets where one is updating the other.
How can I update this data using pandas?
Example, where 'b' updates 'a':
a = {'campo': ['a', 'b', 'c'], 'valor': ["", None, 1]}
b = {'campo': ['a', 'b', 'd'], 'valor': [1, 2, 1]}
Dataframes:
dfa = pd.DataFrame(a)
campo valor
0 a
1 b None
2 c 1
dfb = pd.DataFrame(b)
campo valor
0 a 1
1 b 2
2 d 1
Expected result:
c = {'campo': ['a', 'b', 'c', 'd'], 'valor': [1, 2, 1, 1]}
campo valor
0 a 1
1 b 2
2 c 1
3 d 1
I tried several pandas.Concat and pandas.merge.. available in https://pastebin.com/embed_iframe/X4WjuLHU