【问题标题】:How to only generate the correlations and scatter plots using Pandas Profilling package?如何仅使用 Pandas Profiling 包生成相关性和散点图?
【发布时间】:2020-08-22 06:33:46
【问题描述】:

我正在处理一个大型数据集,并且我使用了 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?您可以使用 df.corr() 获得相关矩阵
  • 我正在使用,以便获得完整的 EDA,这样我在展示某人时就不必重新工作。

标签: python pandas pandas-profiling


【解决方案1】:

这是部分可能的。

要将 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 包含显着的性能改进,这也可能解决您的问题。)

【讨论】:

    猜你喜欢
    • 2016-09-29
    • 2017-12-11
    • 2021-10-29
    • 2019-04-24
    • 2021-02-13
    • 2017-04-29
    • 2018-05-17
    • 2015-05-28
    • 2022-08-12
    相关资源
    最近更新 更多