bom dia , estou tentando criar uma tabela a partir de um groupby com pandas a partir de um arquivo CSV
total = julho.groupby('motivo').sum().to_frame().reset_index()
aparace o seguinte erro:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-26-49bf75385f1b> in <module>
----> 1 total = julho.groupby('motivo').sum().to_frame().reset_index()
~/.pyenv/versions/3.7.4/lib/python3.7/site-packages/pandas/core/generic.py in __getattr__(self, name)
5177 if self._info_axis._can_hold_identifiers_and_holds_name(name):
5178 return self[name]
-> 5179 return object.__getattribute__(self, name)
5180
5181 def __setattr__(self, name, value):
AttributeError: 'DataFrame' object has no attribute 'to_frame'