I am in the middle of an eda process using the pandas profiling and for a specific dataframe I have the error
'DataFrame' object has no attribute 'name'
From what I could discover this attribute should not exist. I can visualize it when doing df.columns and in other dataframes it does not appear. I also can not change it with df.name = 'name here'. Is there any way to remove it?
I am creating a script with Jupyter Lab installed by Anaconda.
My code:
import pandas_profiling as pp
df_planilhas.columns
Index(['VIAGEM', 'OT', 'DATA', 'HORA', 'CARGA', 'NF', 'TIPONF', 'CIA',
'ORIGEM', 'CIA', 'DESTINO', 'TRANSP', 'PLACA', 'FRETE', 'ITENS',
'CUBAGEMREAL', 'PESOREAL', 'VALOR', 'TIPO', 'COD', 'FLAG',
'OBSERVAÇÃO'],
dtype='object', **name=0**)
profile = pp.ProfileReport(df_planilhas)
AttributeError Traceback (most recent call last) in ----> 1 profile = pp.ProfileReport(df_planilhas)
~\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas_profiling__init__.py in init(self, df, **kwargs) 64 sample = kwargs.get('sample', df.head()) 65 ---> 66 description_set = describe(df, **kwargs) 67 68 self.html = to_html(sample,
~\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas_profiling\describe.py in describe(df, bins, check_correlation, correlation_threshold, correlation_overrides, check_recoded, pool_size, **kwargs) 413 'table': table_stats, 414 'variables': variable_stats.T, --> 415 'freq': {k: (base.get_groupby_statistic(df[k])[0] if variable_stats[k].type != base.S_TYPE_UNSUPPORTED else None) for k in df.columns}, 416 'correlations': {'pearson': dfcorrPear, 'spearman': dfcorrSpear} 417 }
~\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas_profiling\describe.py in (.0) 413 'table': table_stats, 414 'variables': variable_stats.T, --> 415 'freq': {k: (base.get_groupby_statistic(df[k])[0] if variable_stats[k].type != base.S_TYPE_UNSUPPORTED else None) for k in df.columns}, 416 'correlations': {'pearson': dfcorrPear, 'spearman': dfcorrSpear} 417 }
~\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas_profiling\base.py in get_groupby_statistic(data) 42 value count and distinct count 43 """ ---> 44 if data.name is not None and data.name in _VALUE_COUNTS_MEMO: 45 return _VALUE_COUNTS_MEMO[data.name] 46
~\AppData\Local\Continuum\anaconda3\lib\site-packages\pandas\core\generic.py in getattr(self, name) 4374 if self._info_axis._can_hold_identifiers_and_holds_name(name): 4375
return self[name] -> 4376 return object.getattribute(self, name) 4377 4378 def setattr(self, name, value):AttributeError: 'DataFrame' object has no attribute 'name'