0

I've a dataframe df1

city      population       ratio      approval
NY          10000          3:4        yes
LA          20000          1:2        no
FL          20000          1:3        yes

Also, my second df2 looks like

city      population     ration     approval
 NY        20000          1:4       accepted
 FL        20000          5:4       declined

my third df3 looks like

city      population    approval
NY        20000          yes
FL        10000          no

How can I append all these dataframes into a single dataframe based on column names? And I've tried a couple of solutions but df3 doesn't contain all the columns compared to df1 and df2, I'm a bit stuck here.

Desired result

city    population         ratio         approval
 NY          10000          3:4            yes
 LA          20000          1:2            no
 FL          20000          1:3            yes
 NY          20000          1:4           accepted
 FL          20000          5:4           declined
 NY          20000          none            yes
 FL          10000          none            no
jperezmartin
  • 407
  • 4
  • 19
Digital404
  • 31
  • 3

0 Answers0