How do I combine two dataframes?
Use pd.concat
to join multiple dataframes:
df_merged = pd.concat([df1, df2], ignore_index=True, sort=False)
DEPRECATED:
DataFrame.append
andSeries.append
were deprecated in v1.4.0.
Use append
:
df_merged = df1.append(df2, ignore_index=True)
And to keep their indexes, set ignore_index=False
.