用途:YData Profiling(原 pandas-profiling)用于自动生成数据质量报告,帮助快速了解数据集。适用场景包括数据质量评估、初次数据探索、缺失值分析、变量分布与特征分析、数据文档化、训练集与测试集或前后版本对比、面向相关方的报告输出,以及机器学习训练前的数据校验。
主要能力:变量分析与类型检测;缺失值分析;相关性计算(Pearson、Spearman、Kendall、Phi-K);大数据集处理(minimal 模式、抽样);数据集对比报告;HTML 报告定制;时间序列剖析;可与 Streamlit、Polars 集成。
安装:pip install ydata-profiling;含全部可选依赖:pip install 'ydata-profiling[all]';使用 uv:uv pip install ydata-profiling pandas numpy;Jupyter 支持:pip install ydata-profiling ipywidgets notebook。验证:python -c "from ydata_profiling import ProfileReport; print('YData Profiling ready!')"。
基本用法:从 ydata_profiling 导入 ProfileReport,传入 pandas DataFrame 生成报告;对比可用 compare。
限制:不适合实时或流式数据剖析、高度定制的可视化、交互式仪表盘(可改用 Streamlit 或 Dash)、超过 1000 万行的超大数据集(需抽样或 minimal 模式),以及需要轻量校验的生产流水线(可考虑 Great Expectations)。
资源:官方文档 https://docs.profiling.ydata.ai/ ;GitHub https://github.com/ydataai/ydata-profiling ;PyPI https://pypi.org/project/ydata-profiling/ ;从 pandas-profiling 迁移指南 https://docs.profiling.ydata.ai/latest/migration/ 。