Created
August 2, 2016 23:40
-
-
Save sneg55/6b43ccb3ebb4fce8c98ddb275710ca54 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
fill_ratio_1 = defaultdict(lambda: defaultdict(int)) | |
fill_ratio = 0 | |
for col in count_df.columns: | |
if count_df[col].max() > 100000: | |
a = count_df[col] | |
for length, count in maxcombinations.items(): | |
fill_ratio = float(a[length])/float(count) | |
fill_ratio_1[col][length] = fill_ratio | |
%matplotlib inline | |
import matplotlib | |
matplotlib.use('agg') | |
import matplotlib.pyplot as plt | |
for tld,counters in counter.items(): | |
if sum(counter[tld].values()) > 1000000: | |
plt.bar(maxcombinations.keys(), maxcombinations.values(), color = '0.75') | |
plt.bar(counter[tld].keys(), counter[tld].values(), color='g') | |
plt.axis([2, 25, 1, max(counter[tld].values())*4]) | |
plt.xlabel('Characters') | |
plt.ylabel('# of domains') | |
plt.title('Number of domain names + available combinations/length for .{}'.format(tld)) | |
plt.xticks([i for i in range(0,25)]) | |
plt.grid(True, which='both') | |
plt.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment