安装
pip安装
pip install https://github.com/pandas-profiling/pandas-profiling/archive/master.zip
conda安装
conda install -c conda-forge pandas-profiling
快速上手
-
分析
profile = ProfileReport(df)参数 作用 类型 minimal 最小化模式:一般用于大型数据集 bool explorative 探索? bool title 报告的标题 string pool_size 线程数,0为使用全部线程(默认) int progress_bar 是否显示进度条 bool
更多参数用法可以参考官方文档
- 将结果保存至本地
profile.to_file("your_report.html")
集成到PyCharm
pandas-profiling可以很方便的集成到PyCharm中,方法如下:
- 打开PyCharm的File-Settings-Tools-External tools
- 点击+进行添加

- 分别填入如下信息:
- Name: Pandas Profiling
- Program: 请自行在Anaconda目录下的Scripts中查找pandas_profiling.exe的路径,如果当前使用的不是base环境需要进入envs的对应虚拟环境下的Scripts中查找pandas_profiling.exe的路径
- Working Directory: $ ProjectFileDir $
- Arguments: “$ FilePath $ " " $ FileDir $ / $ FileNameWithoutAllExtensions $_report.html”
请将上述路径中的空格删除

- 确定后即可使用,使用方法为在PyCharm中找到需要进行分析的数据文件,右键选中External tools随后选择Pandas Profiling即可,分析结果将会直接保存在数据文件所在的目录下。

本文详细介绍如何使用Pandas Profiling进行数据集的自动化分析,包括通过pip和conda安装Pandas Profiling,如何在PyCharm中集成并使用该工具,以及如何调整参数以优化报告。

355

被折叠的 条评论
为什么被折叠?



