Guided Project: Profitable app. Error

Hi,

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

I’m on the first guided project. I typed this code.

reviews_max = {}

for app in appsgoogle_data:
    name = app[0]
    n_reviews = float(app[3])
    
    if name in reviews_max and reviews_max[name] < n_reviews:
        reviews_max[name] = n_reviews
        
    elif name not in reviews_max:
        reviews_max[name] = n_reviews

What I expected to happen: Should run properly

What actually happened: I get the following error

ValueErrorTraceback (most recent call last)
<ipython-input-9-23c3ea3ce216> in <module>()
      3 for app in appsgoogle_data:
      4     name = app[0]
----> 5     n_reviews = float(app[3])
      6 
      7     if name in reviews_max and reviews_max[name] < n_reviews:

ValueError: could not convert string to float: '3.0M'

Any ideas?

L.Basics.ipynb (7.0 KB)

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

Check Here:

1 Like

Hello

Is that the official solution to this problem from Dataquest?

Regards
L.