You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What am I doing wrong? I get this output:
ValueErrorTraceback (most recent call last)
in ()
2 for app in google_data:
3 name = app[0]
----> 4 n_reviews = float(app[3])
5 if name in reviews_max and reviews_max[name]<n_reviews_max:
6 reviews_max[name]+=n_reviews
ValueError: could not convert string to float: 'Reviews'
when I run this code:
reviews_max = {}
for app in google_data:
name = app[0]
n_reviews = float(app[3])
if name in reviews_max and reviews_max[name]<n_reviews_max:
reviews_max[name]+=n_reviews
elif name not in reviews_max:
reviews_max[name]=n_reviews
print(reviews_max)
Hi, @wadebayo! This is the kind of question that's best to raise in the community. We don't closely monitor the issues on this repo, and there are many people (other students, and also Dataquest content authors and support staff) who can help you in the community!
Activity
magdalene commentedon Nov 7, 2019
Hi, @wadebayo! This is the kind of question that's best to raise in the community. We don't closely monitor the issues on this repo, and there are many people (other students, and also Dataquest content authors and support staff) who can help you in the community!
AshaHirpara commentedon Nov 7, 2019
Closely look at the variable names in these lines:
4. n_reviews = float(app[3])
5. if name in reviews_max and reviews_max[name]<n_reviews_max:
DrChakiO commentedon Dec 7, 2019
I confirm that there is a problem with the column app[3]; non number data could be found like "3.0M". How to clean such data?
khuekhue1999 commentedon Feb 16, 2020
you must delete at row 10472 before