reviews_max = {}
for row in android_dataset[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
print(len(reviews_max))
What I expected to happen: The data set should have 9,659 rows
What actually happened:
ValueError Traceback (most recent call last)
<ipython-input-3-17ea9549b95e> in <module>
4 for row in android_dataset[1:]:
5 name = row[0]
----> 6 n_reviews = float(row[3])
7
8 if name in reviews_max and reviews_max[name] < n_reviews:
ValueError: could not convert string to float: '3.0M'
I suspect this error comes from using the del function in a previous cell. However, using the kernel tab, I restarted and run all. In the previous cell it correctly shows I am left with 10841 rows.
Any help is appreciated. Thanks!