Created
June 8, 2022 23:58
-
-
Save brunokim/5954c60eddfe2353e09264b38b89dce5 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 collections import Counter | |
c = Counter() | |
with open('big_file.txt') as f: | |
for line in f: | |
c[line[:-1]] += 1 # Remove newline from line | |
for key, count in c.most_common(): | |
print(f'{key} - {count}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment