Olá. Tentei repetir os passos do professor, mas ao digitar o comando 'sns.boxplot(medias_por_filme)' deu erro.
Importei o sns e medias_por filme está definido conforme abaixo:
medias_por_filme = notas.groupby('filmeId').mean()['nota']
Poderiam me ajudar, por favor?
Segue erro:
KeyError Traceback (most recent call last) /usr/local/lib/python3.9/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance) 3628 try: -> 3629 return self.engine.getloc(casted_key) 3630 except KeyError as err:
8 frames pandas/libs/hashtableclass_helper.pxi in pandas.libs.hashtable.Int64HashTable.getitem()
pandas/libs/hashtableclass_helper.pxi in pandas.libs.hashtable.Int64HashTable.getitem()
KeyError: 0
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last) /usr/local/lib/python3.9/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance) 3629 return self.engine.getloc(casted_key) 3630 except KeyError as err: -> 3631 raise KeyError(key) from err 3632 except TypeError: 3633 # If we have a listlike key, checkindexing_error will raise
KeyError: 0