I have two pandas.DataFrames which I would like to combine into one. The dataframes have the same number of columns, in the same order, but have column headings in different
I am not sure if this will be simpler than what you had in mind, but if the main goal is for something general then this should be fine with one assumption: The columns in the two files match for example if date is the first column, the translated version will also be the first column.
# number of columns
n_columns = len(df_ger.columns)
# save final columns names
columns = df_uk.columns
# rename both columns to numbers
df_ger.columns = range(n_columns)
df_uk.columns = range(n_columns)
# concat columns
df_out = pd.concat([df_ger, df_uk], axis=0, ignore_index=True)
# rename columns in new dataframe
df_out.columns = columns