Screen Link:
My Code:
reviews_max = {}
apps_data_google = apps_data_google[1:]
for apps in apps_data_google:
name = apps[0]
del apps_data_google[10472]
n_reviews = float(apps[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
unique_apps(apps_data_google)
print('expected length:', len(reviews_max))
What I expected to happen:
successfully converted to the float and print the expected length of 9659
What actually happened:
IndexError Traceback (most recent call last)
<ipython-input-73-fc085cc2e0ba> in <module>
3 for apps in apps_data_google:
4 name = apps[0]
----> 5 del apps_data_google[10472]
6 n_reviews = float(apps[3])
7 if (name in reviews_max) and (reviews_max[name] < n_reviews):
IndexError: list assignment index out of range
Thanks for helping!!!