0

I have 2 df with 3 columns:

df1 columns are : C_Label, C_Area, C_Measure
df2 columns are : B_Label, B_Area, B_Measure

df1 and df2 will have identical values in C_Label and B_Label.
I would like to join df1 and df2 (6 columns final) if the value in C_Label is identical to the value in B_Label.

I tried something like that but it didn't work.
dfconc = pd.concat([df1,df2], axis=1, if df1.C_Label == df2.Label)
I also wanted to try:
dfconc = pd.concat([df1,df2], axis=1, on())
But I am very lost on what to put after the on...

Thank you in advance for you help !

Orohena
  • 33
  • 6
  • You need to provide sample data. However, if I were to guess `df1.merge(df2, left_on='C_Label', right_on='B_Label')` – piRSquared Apr 09 '20 at 16:37
  • Thank you @piRSquared ! It works perfectly ! I didn't know how to input the 2 names of column I wanted to use :) Again, Thank you! – Orohena Apr 10 '20 at 07:53

0 Answers0