使用python熊猫
我正在尝试在pandas中编写一个条件,它将匹配两个不同excel文件中的两列,这两个文件具有相同的列名和不同的数值。每列有2000行要匹配。你知道吗
条件:
- 如果最终值=(如果File1(column1value)-File2(column1value)=0,则用1更新该值
- 如果File1(column1value)-File2(column1value)小于或等于0.2,则保留File1Column1Value
- 如果(File1Column1)-File2(column1value)大于0.2。用0更新值。你知道吗
https://i.stack.imgur.com/Nx3WA.jpg
Tags:
也可以删除旧列
df.drop('column', axis = 1)
相关问题 更多 >
编程相关推荐