Guided project 1.Most common apps by genre. Part 3

Screen Link: <!–¶%20We%20start%20by%20examining%20the%20ffrequency%20table%20for%20the%20prime_genre%20column%20of%20the%20App%20store%20data%20set%20display_table(ios_final,%20-5)%20Catalogs%20:%200.12414649286157665/11/most-common-apps-by-genre-part-three--

My Code:

display_table (ios_final, -5)

What I expected to happen:

Games : 58.16263190564867
Entertainment : 7.883302296710118
Photo & Video : 4.9658597144630665
Education : 3.662321539416512
Social Networking : 3.2898820608317814
Shopping : 2.60707635009311
Utilities : 2.5139664804469275
Sports : 2.1415270018621975
Music : 2.0484171322160147
Health & Fitness : 2.0173805090006205
Productivity : 1.7380509000620732
Lifestyle : 1.5828677839851024
News : 1.3345747982619491
Travel : 1.2414649286157666
Finance : 1.1173184357541899
Weather : 0.8690254500310366
Food & Drink : 0.8069522036002483
Reference : 0.5586592178770949
Business : 0.5276225946617008
Book : 0.4345127250155183
Navigation : 0.186219739292365
Medical : 0.186219739292365
Catalogs : 0.12414649286157665

What actually happened:

Food & Drink : 0.8069522036002483

I get only one item displayed . When I run the cell again, still one item is displayed.This
happens even when I try to display the columns for the category and genre columns for Google play. I don’t seem to find the solution in the community .

Kindly have a look at the function you have prepared for display_table. There can an error of like indentation in that which leads to this.

Thanks for your reply
I have tried to adjust the indent and there is still no change .

Could you send a copy of the whole code until now? So that I can backtrack the error.

    table = {}
    total = 0
    for row in dataset:
        total += 1
        value = row[index]
        if value in table:
            table[value] += 1
            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_sorted = sorted(table_display, reverse = True)
    for entry in table_sorted:
        print(entry[1], ':', entry[0])```

Everything seems correct. :exploding_head:

Could you send me the .ipynb file of yours. I should better run your file in my system to check the error.


I am not able to open this file. It is showing error. Kindly download and upload the file in here. :smiley:

Project 1.ipynb (21.8 KB)

Click here to view the jupyter notebook file in a new tab

The ‘Download as’ in the file drop down menu doesn’t respond when I click on it…in Jupyter. .I instead saved the link to the file and uploaded it here . hope it helps.

The link produces this error:

400 : Bad Request

Error reading JSON notebook

I am getting this error buddy.

Maybe this link will help:

1 Like

Thanks will try it out.

1 Like

Project 1.ipynb (30.4 KB)

I hope this works

Click here to view the jupyter notebook file in a new tab

I can confirm that it does!

Wow …at last. Other wise i got errors when i tried the method/link you posted earlier.
In addition the Download as works on my PC not on my laptop. Capacity issue probably.

Congrats! It can be a real struggle dealing with uploading/downloading of files.

I’m working on a project at the moment but I will get back to your code to see if I can help later on today.

Thanks…will be waiting

I couldn’t help myself…I looked at your code and I think I see it!

You’re missing an s on your variable genre_ios