Pandas: control new column names when merging two dataframes?

前端 未结 3 1064
北恋
北恋 2021-02-05 05:35

I would like to merge two Pandas dataframes together and control the names of the new column values.

I originally created the dataframes from CSV files. The original CS

3条回答
  •  旧巷少年郎
    2021-02-05 06:15

    Another way is adding suffix to the columns of your dataframe before merging:

    ad.columns = 'ad_' + ad.columns.values
    

提交回复
热议问题