9
CSV-файл, написанный на Python, содержит пустые строки между каждой строкой
import csv with open('thefile.csv', 'rb') as f: data = list(csv.reader(f)) import collections counter = collections.defaultdict(int) for row in data: counter[row[10]] += 1 with open('/pythonwork/thefile_subset11.csv', 'w') as outfile: writer = csv.writer(outfile) for row in data: if counter[row[10]] >= 504: writer.writerow(row) Этот код читает thefile.csv, вносит изменения и записывает результаты thefile_subset1. Однако, …