Skip to content

Instantly share code, notes, and snippets.

@qlkvg
Created October 31, 2017 13:59
Show Gist options
  • Select an option

  • Save qlkvg/65573a346d114fc0d9c5e560ea11ce6e to your computer and use it in GitHub Desktop.

Select an option

Save qlkvg/65573a346d114fc0d9c5e560ea11ce6e to your computer and use it in GitHub Desktop.
from pprint import pprint
from collections import Counter
import csv
from itertools import chain
with open('Sj.csv', 'r', encoding='cp1251') as f:
reader = csv.reader(f)
your_list = list(reader)
def flatten(listOfLists):
return chain.from_iterable(listOfLists)
flat = list(flatten(your_list))
# pprint(dict(Counter(flat)))
pprint(dict((i,j) for (i, j) in dict(Counter(flat)).items() if j >= 8))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment