python - Join on the basis of RowId -
df1= 3 4.760291 1 4.551454 2 4.507637 df2= 1 verygood 2 3 notbad
right join 2 dataframe on basis of rowid,is possible join 2 different dataframes on basis of rowid(as don't have matching column)
expected output 3 4.760291 notbad 1 4.551454 verygood 2 4.507637
please let me know thoughts on in sql can join on basis of rowid,please guide me in achieving above logic
iiuc either join
or merge
should work here:
in [6]: df1.merge(df2, left_index=true, right_index=true) out[6]: 1_x 1_y 0 1 4.551454 verygood 2 4.507637 3 4.760291 notbad
i expect df1.join(df2)
work
Comments
Post a Comment