如何仅使用 Pandas Profilling 包生成相关性和散点图?

How to only generate the correlations and scatter plots using Pandas Profilling package?

我正在处理一个大型数据集,并且我使用了 Pandas Profilling 包。但由于数据集很大,生成报告的时间太长,浏览器无法打开它。 所以,我使用了 "mininmal=True" 命令,它排除了相关矩阵和散点图。有什么方法可以使用 Pandas Profilling.

仅生成相关矩阵和散点图
from pandas_profiling import ProfileReport
profile = ProfileReport(df, title='EDA_Raw_Data', html={'style':{'full_width':True}},minimal=True)
profile.to_file(output_file="EDA1_Raw_Data.html")

这是部分可能的。

要将 pandas-profiling 的配置设置为仅显示散点图(或 hexbins)和相关图,您可以从最小配置开始:

https://github.com/pandas-profiling/pandas-profiling/blob/master/src/pandas_profiling/config_minimal.yaml

然后,更改配置以排除您要禁用的计算(例如,将样本设置为零)。

from pandas_profiling import ProfileReport
profile = ProfileReport(df, configuration_file="your_config.yml")
profile.to_file("EDA1_Raw_Data.html")

请注意,目前无法禁用所有计算(在 v2.6.0 中)。请为此在存储库中提出功能请求。

(免责声明:作者在此。请注意,即将发布的 v2.7.0 包含重大的性能改进,这也可能会解决您的问题。)