1

I am using Pandas-profiling to generate a report for my data. The code is as follows

# importing the library
from pandas_profiling import ProfileReport

# getting a small subset and passing into ProfileReport constructor
sub = general_data.head()
ProfileReport(sub)

This seems to throw a completely unrelated error about the attr module. That it does not have an attribute "s". I understand there are two different modules attr and attrs and that the later has s as an attribute. This is the link that talks about that, AttributeError: module 'attr' has no attribute 's'

Thanks a lot for the help.

 ---------------------------------------------------------------------------
             AttributeError                            Traceback (most recent call last)
 in 
      1 from pandas_profiling import ProfileReport
      2 sub = general_data.head()
----> 3 ProfileReport(sub)

D:\anaconda\lib\site-packages\pandas_profiling\__init__.py in __init__(self, df, minimal, config_file, **kwargs)
     68 
     69         # Get dataset statistics
---> 70         description_set = describe_df(df)
     71 
     72         # Build report structure

D:\anaconda\lib\site-packages\pandas_profiling\model\describe.py in describe(df)
    600             with multiprocessing.pool.ThreadPool(pool_size) as executor:
    601                 for i, (column, description) in enumerate(
--> 602                     executor.imap_unordered(multiprocess_1d, args)
    603                 ):
    604                     series_description[column] = description

D:\anaconda\lib\multiprocessing\pool.py in next(self, timeout)
    746         if success:
    747             return value
--> 748         raise value
    749 
    750     __next__ = next                    # XXX

D:\anaconda\lib\multiprocessing\pool.py in worker(inqueue, outqueue, initializer, initargs, maxtasks, wrap_exception)
    119         job, i, func, args, kwds = task
    120         try:
--> 121             result = (True, func(*args, **kwds))
    122         except Exception as e:
    123             if wrap_exception and func is not _helper_reraises_exception:

D:\anaconda\lib\site-packages\pandas_profiling\model\describe.py in multiprocess_1d(args)
    386     """
    387     column, series = args
--> 388     return column, describe_1d(series)
    389 
    390 

D:\anaconda\lib\site-packages\pandas_profiling\model\describe.py in describe_1d(series)
    366         if series_description["type"] in type_to_func:
    367             series_description.update(
--> 368                 type_to_func[series_description["type"]](series, series_description)
    369             )
    370         else:

D:\anaconda\lib\site-packages\pandas_profiling\model\describe.py in describe_categorical_1d(series, series_description)
    163         stats["min_length"] = series.str.len().min()
    164 
--> 165         from visions.application.summaries.series.text_summary import text_summary
    166 
    167         stats.update(text_summary(series))

~\AppData\Roaming\Python\Python37\site-packages\visions\__init__.py in 
----> 1 from visions import core
      2 from visions import utils
      3 
      4 from visions.core.dtypes.boolean import BoolDtype
      5 from visions.core.implementations.types import *

~\AppData\Roaming\Python\Python37\site-packages\visions\core\__init__.py in 
----> 1 from visions.core import model
      2 from visions.core import implementations
      3 from visions.core.functional import (
      4     type_cast_frame,
      5     type_inference_frame,

~\AppData\Roaming\Python\Python37\site-packages\visions\core\model\__init__.py in 
----> 1 from visions.core.model.type import VisionsBaseType, TypeRelation
      2 from visions.core.model import typeset
      3 from visions.core.model.typeset import VisionsTypeset

~\AppData\Roaming\Python\Python37\site-packages\visions\core\model\type.py in 
     38 
     39 
---> 40 @attr.s(frozen=True)
     41 class TypeRelation:
     42     """Relationship encoder between implementations of :class:`visions.core.models.VisionsBaseType`

AttributeError: module 'attr' has no attribute 's' here

1 Answer 1

1

For future reference, this issue occurred with a previous version of pandas-profiling. Updating to the latest version resolves the issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.