Skip to content

What I am doing wrong #88

Open
Open

Description

@wadebayo

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)

Activity

  1. magdalene commented on Nov 7, 2019

    @magdalene

    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!

  2. AshaHirpara commented on Nov 7, 2019

    @AshaHirpara

    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:

  3. DrChakiO commented on Dec 7, 2019

    @DrChakiO

    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?

  4. khuekhue1999 commented on Feb 16, 2020

    @khuekhue1999

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions