0

How can I combine two pandas data frames together? They don't share a common column so it seems that merge isn't an option and I lose rows with concat. I want to do something like this

df1=        df2=         df3 = df1+df2          
A B C       D E F        A B C D E F 
1 2 3       1 2 3        1 2 3 1 2 3
4 5 7       4 5 6        4 5 6 4 5 6 
8 9 10                   8 9 10
Rubiks
  • 461
  • 1
  • 6
  • 21
  • 1
    `pd.concat([df1,df2],axis=1)` ? or `df1.combine_first(df2)` – anky Apr 16 '19 at 15:59
  • Concatenating will not lose rows. Whatever row is missing will be filled with NaN. Did you concatenate like anky_91 shows? – tnknepp Apr 16 '19 at 16:05

0 Answers0