Still learning pandas, so please excuse if the question seems naive. I have two dataframes with different number of rows. I want to join them along axis 1.
df1:
Myidx col1 col2 col3
0 a b c
1 d e f
2 g h i
3 j k l
df2:
idx col4 col5 col6
0 m n p
resulting df should look like:
idx col1 col2 col3 col4 col5 col6
0 a b c m n p
1 d e f
2 g h i
3 j k l
I am able to append it to the bottom but joining them along axis1 is not working. I tried using following two things. (The resulting csv file does not even show df2)
1) df1.join(df2)
2) pd.concat([df1,df2], axis =1)
Any help is highly appreciated.
Thanks,