I want to combine two dataframes into one
df1
key columnA
1 0
1 1
1 2
df2
key columnB
1 3
1 5
1 7
result
key columnA columnB
1 0 3
1 1 5
1 2 7
resulting dataframe's column ordering is not important
Edit: I have tried
pd.merge(df1, df2, on ='key', how = 'inner')
it gives me a df of
A key B
0 1 3
0 1 5
0 1 7
1 1 3
1 1 5
1 1 7
2 1 3
2 1 5
2 1 7