我有两个CSV文件。你知道吗
csv\u 1列:
AP Name Mac Switch Port
AP-2-2 001122334455 switchname1 0/37
AP-2-3 554433221100 switchname2 0/41
csv 2列:
Mac Switch Port
001122334455 switchname1 0/37
554433221100 switchname2 0/41
我想根据找到mac地址匹配的时间,用csv_2
中的交换机和端口更新csv_1
中的交换机和端口列(它们不是按顺序排列的)。你知道吗
在python中正确地完成这一任务的最佳和最有效的方法是什么?我知道如何读取CSV文件,只是不知道如何正确地检查值。你知道吗
因为您没有提供具体的代码示例,所以我假设您已经解析了csv文件,并希望获得处理方面的帮助。尝试以下操作:
然后,将csv\u 1写回文件。你知道吗
您可以使用pandas加入新值:
这假设您的csv2对于每个
Mac
值只有一行。你知道吗相关问题 更多 >
编程相关推荐