I have two dataframes df_a and df_b. Both dataframes have index with three items (id / sub_id / sort_id).
I would like to merge these two dataframes with index items.
** df_a **
| c1 | c2 | c3 |
id | sub_id | sort_id | | | |
1 | 1 | 3 | a| b| c|
2 | 1 | 1 | a| b| c|
3 | 1 | 2 | a| b| c|
** df_b **
| c1 | c2 | c3 |
id | sub_id | sort_id | | | |
1 | 1 | 3 | x| y| z|
2 | 1 | 1 | x| y| z|
3 | 1 | 2 | x| y| z|
However I had a KeyError: 'id'
df_merge = pd.merge(df_a, df_b, how='left', left_index=True, right_index=True, left_on=['id','sub_id','sort_id'], right_on=['id','sub_id','sort_id'])
How can I merge these two dataframes?