Created
February 25, 2020 14:38
-
-
Save varokas/8f1c2301db57d8ee920418307bbd349e to your computer and use it in GitHub Desktop.
summary.py
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 | |
with open("test.txt") as f: | |
txt = f.read() | |
start = txt.find("------") + 7 | |
line_items = txt[start:].split("\n") | |
items = [x for x in line_items if x.startswith("-")] | |
cnt = Counter(items) | |
print("All: " + str(sum(cnt.values()))) | |
for k,v in cnt.items(): | |
print(k,v)% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment