Created
July 9, 2019 10:35
-
-
Save mlopatka/dc1c75015bd5ce27131913517a4bb28b to your computer and use it in GitHub Desktop.
parsing and operating the alexa list
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 numpy as np | |
from matplotlib import pyplot as plt | |
a = [] | |
with open('/Users/mlopatka/Documents/backup_downloads/alexa-top-1m.csv', 'rb') as f: | |
for line in f: | |
if len(line) == 43: | |
print(line) | |
a.append(len(line)+3) | |
bins = np.arange(0, 200, 1) # fixed bin size | |
plt.xlim([min(a)-5, max(a)+5]) | |
plt.hist(a, bins=bins, alpha=0.5) | |
plt.xlabel('variable X (bin size = 5)') | |
plt.ylabel('count') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment