我有一个大的排序(公司序列号)csv文件(TNIC数据集为331 MB),它列出了公司之间的成对关联。
每一行都是这样的:
[Score, Some-Company-Serial, Other-Company-Serial, year]
Some-Company-Serial和Other-Company-Serial都是整数。
我想将这个大型CSV文件分解为更短的csv块。每个块只有一个公司与其他公司的分数。是的,
Chunk1:companyA.csv:
[Score, Company-A, Company-B, year]
[Score, Company-A, Company-C, year]
[Score, Company-A, Company-D, year]
[Score, Company-A, Company-E, year]
[Score, Company-A, Company-F, year]
Chunk2:companyB.csv:
[Score, Company-B, Company-A, year]
[Score, Company-B, Company-C, year]
[Score, Company-B, Company-D, year]
[Score, Company-B, Company-E, year]
[Score, Company-B, Company-F, year]
..等等。
这样做有什么好的,快速的和pythonic的方式(或任何其他有效方式)?
CSV文件的样本为here以供参考。
答案 0 :(得分:1)
我会做这样的事情:
sudo service nginx restart