First Project- HELP

Hi!

Can someone help me find number of reviews per category in the Google Play Dataset for the first project

Thanks

Hello @DanielFraga, welcome to the community!

When creating a topic in the Q&A section, it’s important to provide useful information for the people that will try to help you.

Please share the link to the screen that’s causing you problems, the code that you’re trying to run, what you expected from this code, and the output (or error) you’re actually getting.

The more information you provide, the greater are your chances of receiving a fast, accurate answer.

You can read more about how to ask a proper question in the Technical Question Guidelines.

Sorry,
So this is on the Data Analytics Course for Python, its the first guided project on finding the best free apps to develop.
This is the page: https://app.dataquest.io/m/350/guided-project%3A-profitable-app-profiles-for-the-app-store-and-google-play-markets/8/isolating-the-free-apps

I am not sure if you can access it, although here is the most recent code:

for app in free_android_apps:
    if app[1] == 'COMMUNICATION' and (app[5] == '1,000,000,000+'):
        print(app[0], ':', app[5])

WhatsApp Messenger : 1,000,000,000+ 
Messenger – Text and Video Chat for Free : 1,000,000,000+ 
Skype - free IM & video calls : 1,000,000,000+ 
Google Chrome: Fast & Secure : 1,000,000,000+ 
Gmail : 1,000,000,000+ 
Hangouts : 1,000,000,000+

This would suggest that the communications sector is dominated and much harder for new apps to find traction/popularity. Thus, a better option is to understand the amount of reviews per category.

Here I am stuck. I am not getting an error, although I am not getting what I want.
I have tried many ways although forgot to save and thus have no working out.

Can anyone help me?
Let me know if you need any more info.

But what is it that you want?

Your code is producing the expected output from what I can see.

Sorry again, the output from my last message is installs per app.

I want to work out reviews per app.

So this is the code for my functions:

def freq_table(dataset, index):
table = {}
total = 0

for row in dataset:
    total += 1
    value = row[index]
    if value in table:
        table[value] += 1
    else:
        table[value] = 1

table_percentages = {}
for key in table:
    percentage = (table[key] / total) * 100
    table_percentages[key] = percentage 

return table_percentages

def display_table(dataset, index):
table = freq_table(dataset, index)
table_display =
for key in table:
key_val_as_tuple = (table[key], key)
table_display.append(key_val_as_tuple)

table_sorted = sorted(table_display, reverse = True)
for entry in table_sorted:
    print(entry[1], ':', entry[0])


display_table(free_android_apps,5)

1,000,000+ : 15.726534296028879
100,000+ : 11.552346570397113
10,000,000+ : 10.548285198555957
10,000+ : 10.198555956678701
1,000+ : 8.393501805054152
100+ : 6.915613718411552
5,000,000+ : 6.825361010830325
500,000+ : 5.561823104693141
50,000+ : 4.7721119133574
5,000+ : 4.512635379061372
10+ : 3.5424187725631766
500+ : 3.2490974729241873
50,000,000+ : 2.3014440433213
100,000,000+ : 2.1322202166064983
50+ : 1.917870036101083
5+ : 0.78971119133574
1+ : 0.5076714801444043
500,000,000+ : 0.2707581227436823
1,000,000,000+ : 0.22563176895306858
0+ : 0.04512635379061372
0 : 0.01128158844765343

I want categories on the left, and I want the amount of reviews per category on the right.

This is my thinking so far:

reviews = {}

for category in free_android_apps:
category_name = app[1]
n_reviews = float(app[3])

if app_name in reviews:
    reviews[category_name] = n_reviews
else:
    reviews[category_name] = n_reviews

Although this just gives me:

reviews
{‘LIFESTYLE’: 398307.0}

Any help to bring in all categories

reviews = {}

for category in free_android_apps:
category_name = category[1]
n_reviews = category[3]

if category_name in reviews:
    reviews[category_name] = n_reviews
else:
    reviews[category_name] = n_reviews

print(reviews)

{‘ART_AND_DESIGN’: ‘1’, ‘AUTO_AND_VEHICLES’: ‘4’, ‘BEAUTY’: ‘4354’, ‘BOOKS_AND_REFERENCE’: ‘114’, ‘BUSINESS’: ‘0’, ‘COMICS’: ‘291’, ‘COMMUNICATION’: ‘1035’, ‘DATING’: ‘1212’, ‘EDUCATION’: ‘16103’, ‘ENTERTAINMENT’: ‘787177’, ‘EVENTS’: ‘8’, ‘FINANCE’: ‘96’, ‘FOOD_AND_DRINK’: ‘0’, ‘HEALTH_AND_FITNESS’: ‘499’, ‘HOUSE_AND_HOME’: ‘0’, ‘LIBRARIES_AND_DEMO’: ‘332083’, ‘LIFESTYLE’: ‘398307’, ‘GAME’: ‘5442’, ‘FAMILY’: ‘4’, ‘MEDICAL’: ‘3’, ‘SOCIAL’: ‘88486’, ‘SHOPPING’: ‘33599’, ‘PHOTOGRAPHY’: ‘316378’, ‘SPORTS’: ‘1’, ‘TRAVEL_AND_LOCAL’: ‘8’, ‘TOOLS’: ‘885’, ‘PERSONALIZATION’: ‘1’, ‘PRODUCTIVITY’: ‘0’, ‘PARENTING’: ‘27’, ‘WEATHER’: ‘1195’, ‘VIDEO_PLAYERS’: ‘1’, ‘NEWS_AND_MAGAZINES’: ‘881’, ‘MAPS_AND_NAVIGATION’: ‘38’}

This is obviously wrong as some categories show that they only have one review.
Can anyone point out where I am going wrong?