Jupyter Notebook not rendering report with pandas profiling
Asked Answered
L

2

0

I am encountering an issue with generating report using Pandas Profiling library. I have uninstalled and installed the library again in a newly created environment , still not able to generate any report. Only now the table is displayed as shown in ss. Please help me fix it.

import numpy as np
import pandas as pd
from ydata_profiling import ProfileReport```

```from sklearn.datasets import load_diabetes```

```diab_data=load_diabetes()```

```df=pd.DataFrame(data=diab_data.data,columns=diab_data.feature_names)```

```df.head()```
```### To Create the Simple report quickly
profile = ProfileReport(df, title='Pandas Profiling Report')```

```profile.to_widgets()```

I was expecting To see reports being generated and green progress bar but rather i see 0% rendering and tables. Please help me fix it.

No report is rendered using pandas profiling, i only see this piece of code : 

`Summarize dataset:           0%|          | 0/5 [00:00<?, ?it/s]
Generate report structure:   0%|          | 0/1 [00:00<?, ?it/s]
Render widgets:              0%|          | 0/1 [00:00<?, ?it/s]`


`Solution to rendering the report again:`
`pip install -U ipywidgets`
Lusty answered 26/3 at 10:26 Comment(6)
Please do not upload images of code/data/errors. Post them as text instead.Dynamite
Please do it already this time, unless a picture is absolutely necessary, as you risk your post being closed upon review. This is how SO works.Dynamite
How is this post related to your other post from today : https://mcmap.net/q/828382/-jupyter-notebook-javascript-error-when-trying-to-display-the-widgets/12846804 Is this part of the same problem?Dynamite
Yes! It was a part of it. I encountered that problem just today itself when the report atleast rendered itself but the variables section was showing javascript error in that generated report, so i posted that error. I tried fixing it but i think some error has occurred after running some commands and now the report won't even render itself. So hence i had to post this issue as well.Lusty
Do keep tag [python] instead of [data-science], which is mostly uninformativeDynamite
Please provide enough code so others can better understand or reproduce the problem.Craving
F
0

have you tried with

profile = ProfileReport(df, title="Pandas Profiling Report")
profile.to_widgets()

without explorative=True parameter in the profileReport?

Forgotten answered 26/3 at 12:0 Comment(4)
are all packages up to date? Does it work if you do report=profiler.get_description() and report.to_file('my_json.json')? It should save the report in a json file.Forgotten
what about this: Does it work if you do report=profiler.get_description() and report.to_file('my_json.json')? It should save the report in a json fileForgotten
i'm simply a user as you are, just trying to help. If I simply call the profiler (without any command) it is showed to me. It's not as pretty as "to_widgets", but it's fine. I think it's a simple version problem if it doesn't work. I'm using jupyter==1.0.0 jupyter-console==6.6.3 jupyter-events==0.9.0 jupyter-lsp==2.2.2 jupyter_client==8.6.0 jupyter_core==5.5.0 jupyter_server==2.12.0 jupyter_server_terminals==0.4.4 jupyterlab==4.0.9 jupyterlab-widgets==3.0.9 jupyterlab_pygments==0.3.0 jupyterlab_server==2.25.2 ydata-profiling==4.7.0 pandas==2.2.1 with python 3.9.13 on windows.Forgotten
I ran this command and the report got rendered finally : pip install -U ipywidgets it indeeed was some version errorLusty
J
0

for me it renders...

  1. pip install ydata-profiling
  2. pip install ipywidgets
   import matplotlib
   matplotlib.use('TkAgg')  
   from pandas_profiling import ProfileReport

   profile = ProfileReport(df, minimal=True)
   profile.to_notebook_iframe()

Joaquin answered 12/4 at 7:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.