Won't print number of duplicates

Screen Link: https://app.dataquest.io/m/350/guided-project%3A-profitable-app-profiles-for-the-app-store-and-google-play-markets/4/removing-duplicate-entries-part-one

Your Code:

    name = app[0]
    if name == 'Instagram':
        print(app)```

What I expected to happen: That it would print out apps with the same name.  Then when I went on to the next step I could count the number of duplicates.

What actually happened: Nothing -- nothing happened.  I can't get it to print and when I went on to the next step to see what was happening, I got numbers that didn't make sense at all.

Other details:  I've tried this multiple times, went to the solutions to check what I had done and even moved it to my desktop in order to try to find out if it would work there and I've gotten nothing.

Hi Liz. Could you share your notebook file so that someone in the community can have a look and see if they can help troubleshoot? Thanks.

Not sure how to do that but here’s me trying to figure it out…Guided Project_ Profitable App Profiles for the App Store and Google Play Markets.tar (2.0 MB)

Thanks Liz, the .ipynb file is inside that .tar file (along with the CSVs).
I was able to spot the issue in the first cell. You used reader() from the csv module but forgot to use the new read_file to create the list. So instead of getting the list of lists, it had a list of strings. Once this part is fixed, the cells run normally.

opened_file = open('AppleStore.csv', encoding='utf-8')
opened_file_2 = open('googleplaystore.csv', encoding='utf-8')
from csv import reader
read_file = reader(opened_file)
read_file = reader(opened_file_2)  # --> use read_file2, or else it overwrites the file
ios = list(opened_file)          # --> should be read_file instead of opened_file
android = list(opened_file_2)     # --> should be read_file2 instead of opened_file_2
ios_header = ios[0]
ios = ios[1:]
android_header = android[0]
android = android[1:]
1 Like

Ahhh ok, I see it now – thanks! I think maybe I looked at it too many times and then couldn’t see it!

That happens! Sometimes when I’m going over the code I have to go through the line and explain each part out loud as if I’m explaining it to someone else.