I have two Pandas DataFrames that I would like to combine into one. They have the same number of columns, in the same order, but have headers with different names. Is there any approach to efficiently combining these dataframes?
df1
index Data1 Nome1
0 1-1-18 1
1 2-1-18 2
df2
index Data2 Nome2
0 3-1-18 3
1 4-1-18 4
df_concat
index Data Nome
0 1-1-18 1
1 2-1-18 2
2 3-1-18 3
3 4-1-18 4
The only approach I've found so far has been to rename the headers and then use the concat method:
pd.concat([df1, df2, axis = 0, ignore_index = True)
However, I would like to know if there is a more general approach.