O forum do curso de DataScience de pandas está desativado, não consigo fazer perguntas!! Estou tendo um erro e nao consigo solucionar, preciso de ajuda!
matriculas.groupby('id_curso').count().join(cursos['nome_do_curso'])
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
~\Documents\Anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
3802 try:
-> 3803 return self._engine.get_loc(casted_key)
3804 except KeyError as err:
~\Documents\Anaconda3\lib\site-packages\pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
~\Documents\Anaconda3\lib\site-packages\pandas\_libs\index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
pandas\_libs\hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: 'nome_do_curso'
The above exception was the direct cause of the following exception:
KeyError Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_1940\3003734164.py in <module>
----> 1 matriculas.groupby('id_curso').count().join(cursos['nome_do_curso'])
~\Documents\Anaconda3\lib\site-packages\pandas\core\frame.py in __getitem__(self, key)
3802 if self.columns.nlevels > 1:
3803 return self._getitem_multilevel(key)
-> 3804 indexer = self.columns.get_loc(key)
3805 if is_integer(indexer):
3806 indexer = [indexer]
~\Documents\Anaconda3\lib\site-packages\pandas\core\indexes\base.py in get_loc(self, key, method, tolerance)
3803 return self._engine.get_loc(casted_key)
3804 except KeyError as err:
-> 3805 raise KeyError(key) from err
3806 except TypeError:
3807 # If we have a listlike key, _check_indexing_error will raise
KeyError: 'nome_do_curso
Tentei de todas as formas remover este erro mas nao consigo! Preciso de ajuda!