I have 2 dataframes that have 2 columns each (same column names). I want to merge them vertically to end up having a new dataframe.
When doing
newdf = df.merge(df1,how='left',on=['Col1','Col2'])
The new df has only the rows from df
and none of the rows from df1
. Any reasons why this might happen?
Col1 Col2
asd 1232
cac 2324
.....
and the df1
is:
Col1 Col2
afaf 1213
asas 4353
The new dataframe newdf
should be:
Col1 Col2
asd 1232
cac 2324
afaf 1213
asas 4353