使用Python在CSV中制造30w条数据

来源:互联网 发布:spark 运行tensorflow 编辑:程序博客网 时间:2024/06/02 01:22

使用Python在CSV中制造30w条数据

import csv# write csvwith open ("test30w.csv", "wb+") as f:    writer = csv.writer(f)    list_write = ("testttttttt{0}".format(i) for i in xrange(300000))    [writer.writerow([x]) for x in list_write]# read csvwith open("test30w.csv", "r") as f:    reader = csv.reader(f)    for line in reader:        print line
原创粉丝点击