Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What I am doing wrong #88

Open
wadebayo opened this issue Nov 7, 2019 · 4 comments
Open

What I am doing wrong #88

wadebayo opened this issue Nov 7, 2019 · 4 comments

Comments

@wadebayo
Copy link

wadebayo commented Nov 7, 2019

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)

@magdalene
Copy link

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
Copy link

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
Copy link

DrChakiO commented 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
Copy link

you must delete at row 10472 before

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants