У меня есть фрейм данных под названием комбинированный.Я беру подмножество этого фрейма данных, называю его A. Когда я делаю Profilereport в сочетании, проблем нет.Когда я делаю отчет для AI, получаю вышеупомянутую ошибку.Вот код:
A = combined.loc[combined.xy== False]
pandas_profiling.ProfileReport(A) #this gives me the error
pandas_profiling.ProfileReport(combined.loc[combined.xy== False]) #same error
pandas_profiling.ProfileReport(combined) # no error
Вот ошибка:
C:\Users\xy\AppData\Local\Continuum\Anaconda2\envs\py36\lib\site-packages\pandas_profiling\report.py:60: RuntimeWarning: invalid value encountered in longlong_scalars
width = int(freq / max_freq * 99) + 1
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-74-bf3aa50b97ad> in <module>()
----> 1 pandas_profiling.ProfileReport(A)
~\AppData\Local\Continuum\Anaconda2\envs\py36\lib\site-packages\pandas_profiling\__init__.py in __init__(self, df, **kwargs)
67
68 self.html = to_html(sample,
---> 69 description_set)
70
71 self.description_set = description_set
~\AppData\Local\Continuum\Anaconda2\envs\py36\lib\site-packages\pandas_profiling\report.py in to_html(sample, stats_object)
172 templates.template('freq_table'), templates.template('freq_table_row'), 10)
173 formatted_values['firstn_expanded'] = extreme_obs_table(stats_object['freq'][idx], templates.template('freq_table'), templates.template('freq_table_row'), 5, n_obs, ascending = True)
--> 174 formatted_values['lastn_expanded'] = extreme_obs_table(stats_object['freq'][idx], templates.template('freq_table'), templates.template('freq_table_row'), 5, n_obs, ascending = False)
175
176 rows_html += templates.row_templates_dict[row['type']].render(values=formatted_values, row_classes=row_classes)
~\AppData\Local\Continuum\Anaconda2\envs\py36\lib\site-packages\pandas_profiling\report.py in extreme_obs_table(freqtable, table_template, row_template, number_to_print, n, ascending)
123
124 for label, freq in six.iteritems(obs_to_print):
--> 125 freq_rows_html += _format_row(freq, label, max_freq, row_template, n)
126
127 return table_template.render(rows=freq_rows_html)
~\AppData\Local\Continuum\Anaconda2\envs\py36\lib\site-packages\pandas_profiling\report.py in _format_row(freq, label, max_freq, row_template, n, extra_class)
58
59 def _format_row(freq, label, max_freq, row_template, n, extra_class=''):
---> 60 width = int(freq / max_freq * 99) + 1
61 if width > 20:
62 label_in_bar = freq
ValueError: cannot convert float NaN to integer
Я надеюсь, что вы, ребята, можете мне помочь.