5

As I was practicing my visualization skills, I came across an article ,

https://towardsdatascience.com/complete-guide-to-data-visualization-with-python-2dd74df12b5e.

In this, the person has used pandas-profiling method, which was new to me I tried using it for my dataset but got an unexpected error.

Here is the code :

    import pandas_profiling
    from pandas_profiling import ProfileReport
    prof = ProfileReport(temp)
    prof.to_file(output_file='report.html')

but getting this error:

---------------------------------------------------------------------------
FileNotFoundError                         Traceback (most recent call last)
~\anaconda3\lib\site-packages\matplotlib\style\core.py in use(style)
    114             # rcParamsDefault, no need to reemit them here.
--> 115             with cbook._suppress_matplotlib_deprecation_warning():
    116                 _apply_style(rcParamsDefault, warn=False)

~\anaconda3\lib\site-packages\matplotlib\__init__.py in rc_params_from_file(fname, fail_on_error, use_default_template)
    795     """
--> 796     Construct a `RcParams` instance from file *fname*.
    797 

~\anaconda3\lib\site-packages\matplotlib\__init__.py in _rc_params_in_file(fname, transform, fail_on_error)
    724         with cbook._suppress_matplotlib_deprecation_warning():
--> 725             yield from sorted(dict.__iter__(self))
    726 

~\anaconda3\lib\contextlib.py in __enter__(self)
    112         try:
--> 113             return next(self.gen)
114         except StopIteration:

~\anaconda3\lib\site-packages\matplotlib\__init__.py in _open_file_or_url(fname)
    702                 from matplotlib import pyplot as plt
--> 703                 plt.switch_backend(rcsetup._auto_backend_sentinel)
    704 

FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\a\\anaconda3\\lib\\site-packages\\pandas_profiling\\pandas_profiling.mplstyle'

The above exception was the direct cause of the following exception:

OSError                                   Traceback (most recent call last)
<ipython-input-61-8913bd122e77> in <module>
      1 import pandas_profiling
      2 from pandas_profiling import ProfileReport
----> 3 prof = ProfileReport(temp)
      4 prof.to_file(output_file='report.html')

~\anaconda3\lib\site-packages\pandas_profiling\__init__.py in __init__(self, df, **kwargs)

~\anaconda3\lib\site-packages\pandas_profiling\describe.py in describe(df, bins, check_correlation, correlation_threshold, correlation_overrides, check_recoded, pool_size, **kwargs)

~\anaconda3\lib\site-packages\matplotlib\style\core.py in use(style)
    116                 _apply_style(rcParamsDefault, warn=False)
    117         elif style in library:
--> 118             _apply_style(library[style])
    119         else:
    120             try:

OSError: 'C:\\Users\\a\\anaconda3\\lib\\site-packages\\pandas_profiling\\pandas_profiling.mplstyle' not found in the style library and input is not a valid URL or path; see `style.available` for list of available styles

I don't know what is mpl.style, as there was nothing in this location when checked.

4 Answers 4

4

Use ydata-profiling instead of pandas-profiling as pandas-profiling is deprecated.

steps:

  1. pip install ydata-profiling

  2. import ydata_profiling as yp

import pandas as pd
from ydata_profiling import ProfileReport

df = pd.read_csv('data.csv')
profile = ProfileReport(df, title="Profiling Report")
Sign up to request clarification or add additional context in comments.

Comments

0

Do the following steps:

  1. pip uninstall pandas-profiling
  2. pip install pandas-profiling[notebook]
  3. pip show pandas-profiling

1 Comment

If it doesn't work, try doing these steps: 1. conda update pip 2. pip uninstall pandas-profiling 3. pip install pandas-profiling[notebook] 4. pip show pandas-profiling if there is a problem:“500 : Internal Server Error” try: conda install nbconvert=5.4.1
0

Run below commands on jupyter Notebook

!pip uninstall -y pandas-profiling

then

pip install pandas-profiling

Now restart Kernel in jupyter notebook and try running your code.

Comments

-1

I was getting the same error the. Here is what I did to solve it.

Note: I was using Anaconda

  • Uninstall the old pandas_profiling
  • Install the latest version using conda install -c conda-forge pandas-profiling=2.6.0

Important: Don't forget to restart the kernal

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.