Skip to content

Instantly share code, notes, and snippets.

@bpowers
Created February 11, 2013 22:39
Show Gist options
  • Save bpowers/4758276 to your computer and use it in GitHub Desktop.
Save bpowers/4758276 to your computer and use it in GitHub Desktop.
if age_max[0] != '[':
if age_min == 'NULL':
age_min = 13
if age_max == 'NULL':
age_max = 65
tages = range(int(age_min),int(age_max)+1)
delta = len(tages)
if not gender in gender_dict:
continue
gdot = gender_dict[gender]
if len(adtype) >= 3:
continue
if int(adtype) not in ad_types:
continue
adtype_int = int(adtype)
for i in tages:
for key in keys:
to_write_out[(int(i),int(gdot),int(adtype_int))][key] +=(stats_dict[tups][key]/delta)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment