跳过内容

安装

使用 pip

您可以使用 pip 包管理器通过运行以下命令进行安装:

    pip install -U ydata-profiling
如果您在 Notebook 环境中(本地、LambdaLabs、Google Colab 或 Kaggle),可以运行以下命令:

1
2
3
    import sys
    !{sys.executable} -m pip install -U ydata-profiling[notebook]
    !pip install jupyter-contrib-nbextensions
之后,您可以运行以下命令:

    !jupyter nbextension enable --py widgetsnbextension
您可能需要重启内核或运行时才能使包生效。

使用 conda

通过 Conda 安装 ydata-profiling

可以通过以下方式创建一个包含该模块的新 conda 环境:

    conda env create -n ydata-profiling
    conda activate ydata-profiling
    conda install -c conda-forge ydata-profiling

提示

Don't forget to specify the ``conda-forge`` channel.       
Omitting it **will not** lead to an error, as an outdated package lives on the ``main`` channel and will be installed. See :doc:`../support_contrib/common_issues` for details.

Jupyter Notebook/Lab 中的小部件

为了使 Jupyter 小部件扩展(用于进度条和交互式基于小部件的报告)正常工作,您可能需要安装并激活相应的扩展。这可以通过 pip 完成:

  pip install ydata-profiling[notebook]
  jupyter nbextension enable --py widgetsnbextension

或者通过 conda 完成:

  conda install -c conda-forge ipywidgets

在大多数情况下,这也将自动配置 Jupyter Notebook 和 Jupyter Lab (>=3.0)。对于两者较旧的版本或更复杂的环境配置,请参阅 官方 ipywidgets 文档

从源代码安装

通过克隆仓库或点击 下载 ZIP 文件来下载源代码。通过导航到解压后的目录并运行以下命令来安装:

   python setup.py install

这也可以通过以下单行命令完成:

  pip install https://github.com/ydataai/ydata-profiling/archive/master.zip

附加功能

该包声明了一些“附加项 (extras)”,即额外的依赖项集。

  • [notebook]: 支持在 Jupyter notebook 小部件中渲染报告。
  • [unicode]: 支持更详细的 Unicode 分析,但这会占用额外的磁盘空间。
  • [pyspark]: 支持使用 Pyspark 引擎在大型数据集上运行概要分析

例如,可以通过以下方式安装这些附加项:

  pip install -U ydata-profiling[notebook,unicode, pyspark]