时间:2021-07-01 10:21:17 帮助过:278人阅读
本文实例讲述了Python实现求两个csv文件交集的方法。分享给大家供大家参考,具体如下:
#!/usr/bin/env python rd3 = open('data_17_17_2.csv') base = open('data_17_17_3.csv') wr3 = open('delNoBuyed3DayAndStoreAndInCar4.5.2.csv','w+') bsData = base.readlines() i = 1 for key in rd3: if key in bsData: wr3.write(key) if i == 1: print key i = (i + 1)%100 rd3.close() base.close() wr3.close()
以上就是Python求两个csv文件交集方法教程的详细内容,更多请关注Gxl网其它相关文章!