Created
October 31, 2017 13:59
-
-
Save qlkvg/65573a346d114fc0d9c5e560ea11ce6e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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