Created
January 23, 2021 14:59
-
-
Save kuzux/fe4f9c0bdb201c6b9f2337b494be68ab to your computer and use it in GitHub Desktop.
This file contains 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
import matplotlib.pyplot as plt | |
import sys | |
filename = sys.argv[1] | |
word = sys.argv[2] | |
f = open(filename) | |
text = f.read() | |
words = text.split() | |
indices = indices = [i for i, x in enumerate(words) if x.lower().startswith(word)] | |
plt.hist(indices, 30, facecolor="green") | |
plt.show() | |
f.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment