Escrevi o seguinte código e deu erro enquanto eu seguia o tutorial, podem me auxiliar? achei frustrante.
import pandas as pd
notas = pd.read_csv("ratings.csv")
notas.head()
notas.shape
notas.column=["usuarioId","filmeId","nota", "momento"]
notas.head()
notas['nota']
KeyError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance) 2897 try: -> 2898 return self.engine.getloc(casted_key) 2899 except KeyError as err:
pandas/libs/index.pyx in pandas.libs.index.IndexEngine.get_loc()
pandas/libs/index.pyx in pandas.libs.index.IndexEngine.get_loc()
pandas/libs/hashtableclass_helper.pxi in pandas.libs.hashtable.PyObjectHashTable.getitem()
pandas/libs/hashtableclass_helper.pxi in pandas.libs.hashtable.PyObjectHashTable.getitem()
KeyError: 'nota'
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
2 frames
/usr/local/lib/python3.6/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance) 2898 return self.engine.getloc(casted_key) 2899 except KeyError as err: -> 2900 raise KeyError(key) from err 2901 2902 if tolerance is not None:
KeyError: 'nota'