I need a help to finish my guided project

Hello, i want some help. in the first guided project i faced a problem in the data set of the google play data set.
reviews_max={}
for row in googleplay_data[1:]:
name= row[0]
n_reviews=float(row[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

ValueError: could not convert string to float: ‘3.0M’

Hi @nagi6752, welcome to the community!

Check out the post below for help with this error!

1 Like

thank you @april.g for quick response, but ‘3.0M’ isn’t an error to remove this row M = 1 million and i need this str to convert to float. but how…!

The reason you’re getting an error is because one of the rows has a mistake. Instead of having a number at row[3], it has '3.0M'. Because it contains a letter, it’s not able to convert it to a float. Once the row with the mistake is deleted, then you should be able to try your code again.

3 Likes

you’re right, thanks very much for helping me :heart_eyes:

1 Like