Skip to content

Instantly share code, notes, and snippets.

@roymartinezblanco
Created July 31, 2020 14:44
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 roymartinezblanco/b907c11ddf16190bc24494b3bfd40dcf to your computer and use it in GitHub Desktop.
Save roymartinezblanco/b907c11ddf16190bc24494b3bfd40dcf to your computer and use it in GitHub Desktop.
First vs Third Party
tmp = dat_clean
tmp = tmp.groupby(['host','host-type','url']).size().reset_index(name='Count')
tmp = tmp.groupby(['host-type']).sum().reset_index()
tmp = tmp.sort_values(by=['Count'],ascending=False)
plt.pie(tmp['Count'],labels=tmp['host-type'],shadow=False,autopct='%1.1f%%')
plt.title('First vs Third Party')
plt.axis('equal')
plt.tight_layout()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment