Guided Project :android_clean length not as expected

Screen Link:

My Code:

android_clean = []
already_added = []

for app in goog_body:
    name = app[0]
    n_reviews = float(app[3])
    
    if (max_reviews[name] == n_reviews) and (name not in already_added):
        android_clean.append(app)
        already_added.append(name) 
        
explore_data(android_clean,0,3,True)

What I expected to happen: length should be 9,659

What actually happened: Got length of 9,311

Replace this line with the output/error

Should have added to my query above…if anyone can help point out the problem in the code resulting in the 9,311 as output instead of the 9,659 as is expected, would appreciate! thanks all.

People can help you better if you also include the link to the Mission Step/Guided Project corresponding to your query. The additional context can help others to answer your questions.

Good point! New here, thanks for the guidance.

Link to the step : App Profile Recommendation | Dataquest

I get the correct data for the reviews_max dictionary i.e. 9,659, however, its the second part of this problem (android_clean) that I get 9,311 instead of the expected 9,659.

Hi again community, anyone know the problem with my code and can share? Do you need further info? Stuck on this step…

I ran your code on my project and I got the answer as expected, 9659.

That indicates that there is a mistake in a step before this piece of code.

1 Like

Thanks for taking a look! I will re check the previous steps. Weird, cause I get the expected solutions for each of them.
Will look some more. Thanks again.

1 Like

Found the error. Was in the max reviews dictionary coding. Thanks for pointing me in the right direction.