简体   繁体   English

使用 python 合并来自不同数据帧的多列

[英]Merging multiple columns from different dataframes using python

I am working on lung cancer detection.我正在从事肺癌检测。 It has been divided into left and right zone.它被分为左区和右区。 Both of these data set has same columns names with different readings.这两个数据集具有相同的列名称和不同的读数。 I have normalized the data.The set of feature level has come down.我已经对数据进行了规范化。特征级别的集合已经下降。 Now i want to merge both of them.现在我想合并它们。 . . How can i proceed?我该如何进行? It might get overridden.它可能会被覆盖。 I am not sure if i need to rename/prefix the same column names with left and right.if this is the correct way.我不确定我是否需要用 left 和 right 重命名/前缀相同的列名。如果这是正确的方法。 I need some help on this.我需要一些帮助。

Here is the sample data set这是样本数据集

   Patient Id       Mean Radius          Mean texture
    190              17.99                   10.38
    198               19.56                   21.25

The same columns are repeated in both datasets with different readings.在具有不同读数的两个数据集中重复相同的列。

Thanks in advance提前致谢

Simply do an append operation:只需执行 append 操作:

df = df1.append(df2, ignore_index=False)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM