To Reproduce
INSTALL THE PACKAGES (CAN BE A NEW SYSTEM):
Download and install Anaconda on a new system.
Install numpy and pandas.
Install pandas-profiling
execute
RUN THE DEMO EXAMPLE:
import numpy as np
import pandas as pd
from pandas_profiling import ProfileReport
df = pd.DataFrame(
np.random.rand(100, 5),
columns=['a', 'b', 'c', 'd', 'e']
)
# THEN RUN
profile = ProfileReport(df, title='Pandas Profiling Report', style={'full_width':True})
HERE's THE RESULT:
ValueError Traceback (most recent call last)
----> 1 profile = ProfileReport(df, title='Pandas Profiling Report', style={'full_width':False})
C:\ProgramData\Anaconda3\lib\site-packages\pandas_profiling__init__.py in __init__(self, df, minimal, config_file, **kwargs)
45 if config_file:
46 config.config.set_file(str(config_file))
---> 47 config.set_kwargs(kwargs)
48
49 self.date = datetime.utcnow()
C:\ProgramData\Anaconda3\lib\site-packages\pandas_profiling\config.py in set_kwargs(self, kwargs)
50
51 """
---> 52 self._set_kwargs(self.config, kwargs)
53
54 def __getitem__(self, item):
C:\ProgramData\Anaconda3\lib\site-packages\pandas_profiling\config.py in _set_kwargs(self, reference, values)
40 reference[key].set(value)
41 else:
---> 42 raise ValueError('Config parameter "{}" does not exist.'.format(key))
43
44 def set_kwargs(self, kwargs) -> None:
### ValueError: Config parameter "style" does not exist.
Additional context
Thank you for reporting this. To documentation didn't yet refect that the style parameters are grouped under 'html' since 2.4.0.
To generate the report, run:
profile = ProfileReport(df, title='Pandas Profiling Report', html={'style':{'full_width':True}})
still I am facing same issue
import numpy as np
import pandas as pd
from pandas_profiling import ProfileReport
df = pd.DataFrame(
np.random.rand(100, 5),
columns=['a', 'b', 'c', 'd', 'e']
)
profile = ProfileReport(df, title='Pandas Profiling Report', html={'style':{'full_width':True}})
TypeError Traceback (most recent call last)
~\AppData\Local\Continuumanaconda3\lib\site-packages\confuse.py in resolve(self)
612 try:
--> 613 value = collection[self.key]
614 except IndexError:
TypeError: 'set' object is not subscriptable
During handling of the above exception, another exception occurred:
ConfigTypeError Traceback (most recent call last)
----> 1 profile=ProfileReport(df,title='Sales',html={'style':{'full_width':True}})
2 #profile = ProfileReport(data, title='Pandas Profiling Report', html={'style':{'full_width':True}})
~\AppData\Local\Continuumanaconda3\lib\site-packages\pandas_profiling__init__.py in __init__(self, df, minimal, config_file, **kwargs)
50 if config_file:
51 config.set_file(str(config_file))
---> 52 config.set_kwargs(kwargs)
53
54 self.date_start = datetime.utcnow()
~\AppData\Local\Continuumanaconda3\lib\site-packages\pandas_profiling\config.py in set_kwargs(self, kwargs)
56
57 """
---> 58 self._set_kwargs(self.config, kwargs)
59
60 def __getitem__(self, item):
~\AppData\Local\Continuumanaconda3\lib\site-packages\pandas_profiling\config.py in _set_kwargs(self, reference, values)
42 if key in reference:
43 if type(value) == dict:
---> 44 self._set_kwargs(reference[key], value)
45 else:
46 reference[key].set(value)
~\AppData\Local\Continuumanaconda3\lib\site-packages\pandas_profiling\config.py in _set_kwargs(self, reference, values)
42 if key in reference:
43 if type(value) == dict:
---> 44 self._set_kwargs(reference[key], value)
45 else:
46 reference[key].set(value)
~\AppData\Local\Continuumanaconda3\lib\site-packages\pandas_profiling\config.py in _set_kwargs(self, reference, values)
40 """Helper function to set config variables based on kwargs."""
41 for key, value in values.items():
---> 42 if key in reference:
43 if type(value) == dict:
44 self._set_kwargs(reference[key], value)
~\AppData\Local\Continuumanaconda3\lib\site-packages\confuse.py in __contains__(self, key)
267
268 def __contains__(self, key):
--> 269 return self[key].exists()
270
271 @classmethod
~\AppData\Local\Continuumanaconda3\lib\site-packages\confuse.py in exists(self)
205 """
206 try:
--> 207 self.first()
208 except NotFoundError:
209 return False
~\AppData\Local\Continuumanaconda3\lib\site-packages\confuse.py in first(self)
197 pairs = self.resolve()
198 try:
--> 199 return iter_first(pairs)
200 except ValueError:
201 raise NotFoundError(u"{0} not found".format(self.name))
~\AppData\Local\Continuumanaconda3\lib\site-packages\confuse.py in iter_first(sequence)
66 it = iter(sequence)
67 try:
---> 68 return next(it)
69 except StopIteration:
70 raise ValueError()
~\AppData\Local\Continuumanaconda3\lib\site-packages\confuse.py in resolve(self)
622 raise ConfigTypeError(
623 u"{0} must be a collection, not {1}".format(
--> 624 self.parent.name, type(collection).__name__
625 )
626 )
ConfigTypeError: html.style must be a collection, not set
Thank you for reporting this. To documentation didn't yet refect that the style parameters are grouped under 'html' since 2.4.0.
To generate the report, run:
profile = ProfileReport(df, title='Pandas Profiling Report', html={'style':{'full_width':True}})
This works perfect. Thanks.
I tried both these codes, none of these work for me.
` df.profile_report(style={'full_width':True})
profile = ProfileReport(df, title='Pandas Profiling Report', html={'style':{'full_width':True}})`
profile = ProfileReport(df, title='Pandas Profiling Report', html={'style':{'full_width':True}}) <--it worked me thank you kkairu
Most helpful comment
Thank you for reporting this. To documentation didn't yet refect that the style parameters are grouped under 'html' since 2.4.0.
To generate the report, run: