I have a dataframe df1 and want to merge other (many) dataframes df2 so that:
- Merge happens on the matching (multi-) indexes
- New columns are created if missing
- Values are replaced if the column already exists
What is the correct pandas operation to use and with what arguments? I looked into concat/join/merge/assign/append but did not find it yet.
Code for dataframes:
df1 = pd.DataFrame({'A':['A1', 'A2', 'A3', 'A4'],
'B':['B1', 'B2' ,'B3', 'B4'],
'C':['C1' ,'C2', 'C3', 'C4']},
index = [1,2,3,4])
df2 = pd.DataFrame({'C':['NewC'], 'D':['NewD']},
index=[3])
