Skip to content

Instantly share code, notes, and snippets.

@sneg55
Created August 2, 2016 23:40
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 sneg55/6b43ccb3ebb4fce8c98ddb275710ca54 to your computer and use it in GitHub Desktop.
Save sneg55/6b43ccb3ebb4fce8c98ddb275710ca54 to your computer and use it in GitHub Desktop.
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