Created
May 16, 2012 20:41
-
-
Save spenthil/2713766 to your computer and use it in GitHub Desktop.
claims in a state that have an email associated with it
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
from collections import Counter | |
state = 'bpi' | |
result = Counter(x.endswith("counsyl.com") for x in InsuranceClaim.objects.filter(status=state).values_list('orderkit__order__profile__user__email', flat=True)) | |
total = sum(result.values()) / 100.0 | |
percentages = {k:int(v/total) for k,v in result.iteritems()} | |
print percentages |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment