我目前正在使用ydata_profiling
个库进行EDA项目.
这是我目前写的代码:
import numpy as np
import pandas as pd
from ydata_profiling import ProfileReport
profile = ProfileReport(df, title='Pandas Profiling Report', explorative=True)
profile.to_widgets()
在显示这.to_widgets()
个代码时,会显示我的数据摘要,但在Variables部分下面,我会看到这个javascript错误:
[Open Browser Console for more detailed log - Double click to close this message]
Model class 'AccordionModel' from module '@jupyter-widgets/controls' is loaded but can not be instantiated
Error: widget model not found
at f.get_model (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1:3460)
at P (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/595.998263bfa9875eeeb29b.js?v=998263bfa9875eeeb29b:1:6289)
at Object.P [as deserialize] (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/595.998263bfa9875eeeb29b.js?v=998263bfa9875eeeb29b:1:6099)
at kt._deserialize_state (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/595.998263bfa9875eeeb29b.js?v=998263bfa9875eeeb29b:1:12378)
at f._make_model (http://localhost:8888/lab/extensions/@jupyter-widgets/jupyterlab-manager/static/336.0a90bd910629a565bb7e.js?v=0a90bd910629a565bb7e:1:7932)
Report generated by YData.
我真的很感激一些建议或修复这个.
解决方案: 请不要忽视更新您的Jupyter笔记本的版本.我更新了整个jupyter笔记本环境,重新加载并解决了问题. 运行如下命令:
jupyter notebook --version
pip install --upgrade notebook