Skip to content

Instantly share code, notes, and snippets.

@illustris
Created March 30, 2020 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save illustris/e0b110ceb7d947dc3795c5deadfa4ef2 to your computer and use it in GitHub Desktop.
Save illustris/e0b110ceb7d947dc3795c5deadfa4ef2 to your computer and use it in GitHub Desktop.
Quick script to count occurrences of terms in metrics
from collections import Counter
c = Counter()
for line in sys.stdin:
c.update(re.findall('.[^A-Z]*', line.split()[2].split('_')[2]))
print(c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment