Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'script_values' while generating HTML report in version 2.7.0 #468

Closed
ankit-crossml opened this issue May 11, 2020 · 1 comment

Comments

@ankit-crossml
Copy link

Describe the bug
I have a dataset of Camera ID's in the house with their location. I am trying to generate pandas_profiling report in HTML format and getting below error traceback:

Traceback (most recent call last):
File "", line 1, in
File "/home/ankit/Projects/pui/big_venv3/lib/python3.7/site-packages/pandas_profiling/profile_report.py", line 324, in to_html
return self.html
File "/home/ankit/Projects/pui/big_venv3/lib/python3.7/site-packages/pandas_profiling/profile_report.py", line 152, in html
self._html = self._render_html()
File "/home/ankit/Projects/pui/big_venv3/lib/python3.7/site-packages/pandas_profiling/profile_report.py", line 253, in _render_html
report = self.report
File "/home/ankit/Projects/pui/big_venv3/lib/python3.7/site-packages/pandas_profiling/profile_report.py", line 146, in report
self._report = get_report_structure(self.description_set)
File "/home/ankit/Projects/pui/big_venv3/lib/python3.7/site-packages/pandas_profiling/report/structure/report.py", line 250, in get_report_structure
render_variables_section(summary),
File "/home/ankit/Projects/pui/big_venv3/lib/python3.7/site-packages/pandas_profiling/report/structure/report.py", line 125, in render_variables_section
template_variables.update(type_to_funcsummary["type"])
File "/home/ankit/Projects/pui/big_venv3/lib/python3.7/site-packages/pandas_profiling/report/structure/variables/render_categorical.py", line 147, in render_categorical
vc = pd.Series(summary["script_values"]).value_counts()
KeyError: 'script_values'

To Reproduce
import numpy as np
import pandas as pd
from pandas_profiling import ProfileReport
df = pd.read_csv("duplicate_missing.csv")
profile = ProfileReport(df)
profile.to_html()

Data:
Please check the attached data.

duplicate_missing.zip

Version information:
2.7.0

@sbrugman
Copy link
Collaborator

sbrugman commented May 11, 2020

This has to do with new features in visions 0.4.2 (which are coupled to pandas-profiling v2.7.2). Installing pandas-profiling v2.7.1 will resolve the issue.

For pandas-profiling v2.7.0 either downgrade visions to 0.4.1 or set vars = {'cat': {'check_composition' : False}}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants