9
El archivo CSV escrito con Python tiene líneas en blanco entre cada fila
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) Este código lee thefile.csv, realiza cambios y escribe resultados thefile_subset1. Sin …