We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Here's my code `diff_categories = freq_table(android_final, 1) for category in diff_categories: total = 0 len_category = 0 for app in android_final: apps_category = app[1] if apps_category == category: n_installs = app[5] n_installs = n_installs.replace('+','') n_installs = n_installs.replace(',','')
total += float(n_installs) len_category += 1 avg_category = total / len_category print(category, " : ", avg_category) `
The text was updated successfully, but these errors were encountered:
Here's my code you can try:
category_android = freq_table(android_final, 1) avg_installs_category = {} # Initialized an empty dictionary for category in category_android: total = 0 len_category = 0 for row in android_final: app_cat = row[1] if app_cat == category: no_installs = row[5] no_installs = no_installs.replace(',', '') no_installs = no_installs.replace('+', '') total += float(no_installs) len_category += 1 avg_installs = total / len_category # print(category, ':', avg_installs) if category in avg_installs_category: avg_installs_category[category] += avg_installs else: avg_installs_category[category] = avg_installs # print(avg_installs_category) avg_installs_cat_tup = [] # Initialized an empty tuple for key in avg_installs_category: val_key = avg_installs_category[key], key avg_installs_cat_tup.append(val_key) print(sorted(avg_installs_cat_tup, reverse=True))
Sorry, something went wrong.
No branches or pull requests
Here's my code `diff_categories = freq_table(android_final, 1)
for category in diff_categories:
total = 0
len_category = 0
for app in android_final:
apps_category = app[1]
if apps_category == category:
n_installs = app[5]
n_installs = n_installs.replace('+','')
n_installs = n_installs.replace(',','')
The text was updated successfully, but these errors were encountered: