i'm quite new to pandas and i'm stuck with this dataframe concatenation. Let's say i've 2 dataframes:
df_1=pd.DataFrame({ "A":[1, 1, 2, 2, 3, 4, 4], "B":[1, 2, 1, 2, 1, 1, 3], "C":['a','b','c','d','e','f','g'] }) and
df_2=pd.DataFrame({ "A":[1, 3, 4], "D":[1,'m',7] }) I would like to concatenate/merge the 2 dataframes on the same values of ['A'] so that the resulting dataframe is:
df_3=pd.DataFrame({ "A":[1, 1, 3, 4, 4], "B":[1, 2, 1, 1, 3], "C":['a','b','e','f','g'], "D":[1, 1, 'm', 7, 7] }) How can i do that?
Thanks in advance