ydata-profiling icon indicating copy to clipboard operation
ydata-profiling copied to clipboard

importing ProfileReport seems to interfere with pandas plotting

Open raybellwaves opened this issue 4 years ago • 2 comments

Describe the bug

Running

from pandas_profiling import ProfileReport
import pandas as pd

seems to interfere with pandas plotting

To Reproduce

Run this as a cell in jupyter lab (may be same as jupyter notebook)

import pandas as pd
from pandas_profiling import ProfileReport

df = pd.DataFrame(data={"col1": [1, 2]})
df.plot()
Screen Shot 2021-09-28 at 5 02 21 PM

Now the same but comment out pandas_profiling

Screen Shot 2021-09-28 at 5 03 39 PM

Version information:

pandas-profiling 3.1.0

raybellwaves avatar Sep 28 '21 21:09 raybellwaves

Good catch. Might have to do with the setting of the backend in 3.1.0.

Two ways of checking this: check if the same happens with 3.0.0 or set the backend of matplotlib after importing PP.

sbrugman avatar Oct 02 '21 17:10 sbrugman

I can confirm the same does not happen on 3.0.0. An easy place to verify is a binder link e.g. https://mybinder.org/v2/gh/scikit-learn/scikit-learn/1.0.X?urlpath=lab/tree/notebooks/auto_examples/release_highlights/plot_release_highlights_1_0_0.ipynb

!conda install -c conda-forge pandas-profiling --y

import pandas as pd
from pandas_profiling import ProfileReport

df = pd.DataFrame(data={"col1": [1, 2]})
df.plot()

Couldn't get 3.0.0 installed in this env.

raybellwaves avatar Oct 11 '21 01:10 raybellwaves