How do I merge two (or more) dataframes based on only their shared column names?
For example:
df1 consists of ["car", "power", "age"]
df2 consists of ["car", "power", "distance"]
When df1 and df2 are being merged, the resulting df should consist of the columns:
["car", "power"]
I tried to do this via merge()
but didn't work. rbind()
and cbind()
won't work on this and inner_join
or outer_join
I also couldn't get to work.