从DF2,DF2中减去DF1,从文件夹中的所有数据中依此类推
我在文件夹中有一些数据帧作为CSV文件。
example1_result.csv
example2_result.csv
example3_result.csv
example4_result.csv
example5_result.csv
我的每个数据框架看起来像以下所有数据
TestID Result1 Result2 Result3
0 0 5 1
1 1 0 4
2 2 1 2
3 3 0 0
4 4 3 0
5 5 0 1
框框架作为结果1.csv。然后example2_result.csv上的类似的扣除操作来自示例3_Result.csv,依此类推。
我想使用Python脚本来做。请帮助我,因为我是Python的新手。谢谢。
I have a few data frames as CSV files in the folder.
example1_result.csv
example2_result.csv
example3_result.csv
example4_result.csv
example5_result.csv
My each data frame looks like following
TestID Result1 Result2 Result3
0 0 5 1
1 1 0 4
2 2 1 2
3 3 0 0
4 4 3 0
5 5 0 1
I want to subtract example1_result.csv from example2_result.csv on the Result1, Result2, and Result3 columns, and save it as a new data frame as result1.csv. Then the similar subtraction operation on example2_result.csv from example3_result.csv, and so on.
I want to do it using python scripts. Please help me as I am a novice in python. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
给定的CSV看起来像:
做:
Given CSVs that look like:
Doing: