0

I have two tables, table A and table B, both have same column names. I want to create a dataframe which will have table B have it's data added to the rows below data from table A.

My code however creates duplicate columns instead of just stacking table B below table A.

df = pd.merge(df_A, df_B, on=['mobile_number'])

How do I go about solving this.

Shadow Walker
  • 327
  • 3
  • 18

1 Answers1

1

You need pd.concat(). it takes a iterable (i.e list) of dataframes and stacks them on top of each other like 'UNION ALL' in SQL