【问题标题】:Merge multiple df in python and keep the same rows only one time在python中合并多个df并只保留一次相同的行
【发布时间】:2022-06-15 16:27:23
【问题描述】:

我正在尝试合并多个数据帧并创建一个新的数据帧,其中包含每个数据帧中的所有行,但只包含一次相同的行。例如:

我作为输入的数据框: input dataframes

我想要作为输出的数据框: output dataframe

你知道有没有办法做到这一点?如果您能帮助我,我将不胜感激!

谢谢, 埃莱尼

【问题讨论】:

  • pd.concat([df1, df2]).drop_duplicates()

标签: python pandas dataframe merge


猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-12-10
  • 1970-01-01
  • 1970-01-01
  • 2022-09-30
  • 1970-01-01
相关资源
最近更新 更多