Pandas: control new column names when merging two dataframes?

前端 未结 3 1049
北恋
北恋 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:02

    The suffixes option in the merge function does this. The defaults are suffixes=('_x', '_y').

    In general, renaming columns can be done with the rename method.

提交回复
热议问题