csv_contents = []
with open('yourfile.csv', 'rb') as fin:
    dict_reader = csv.DictReader(fin)
fieldnames = dict_reader.fieldnames
for line in dict_reader:
    csv_contents.append(line)
sorted_csv_contents = sorted(csv_contents, key=op.itemgetter('Country Name'))
for groupkey, groupdata in it.groupby(sorted_csv_contents, key=op.
    itemgetter('Country Name')):
    with open('slice_{:s}.csv'.format(groupkey), 'wb') as fou:
        dict_writer = csv.DictWriter(fou, fieldnames=fieldnames)
dict_writer.writeheader()
dict_writer.writerows(groupdata)
Как разделить один CSV-файл на несколько меньших, сгруппированных по полю?