-1

I have 2 dataframes as:

df1:

c1  c2
A   1
B   2
C   3

df2:

c1  c2
A   11
B   12
D   14

I want to merge the two dataframes so the output is:

c1  c2  c3
A   1   11
B   2   12
C   3
D       14

How can I achieve this?

cttrader
  • 25
  • 3

1 Answers1

1
pd.merge(df1, df2, on = "c1", how = "outer")

Read the documentation for more information.

Mark
  • 7,785
  • 2
  • 14
  • 34