【问题标题】:don't use index in pandas-profiling不要在熊猫分析中使用索引
【发布时间】:2020-11-03 13:55:32
【问题描述】:

在数据框上运行 pandas-profiling 时,我看到它会将索引作为变量进行分析。注意:我的索引是唯一键(命名为 UUID)

有没有办法排除引入索引来报告?

我知道我可以在 pandas 中删除它,但我想这样做

ProfileReport(df, use_index=False)

【问题讨论】:

    标签: pandas-profiling


    【解决方案1】:

    我同意在ProfileReport 中选择use_index=False 会很干净,但它显然不存在(目前)。

    所以目前我能找到排除将索引带入报告的唯一方法是在分析之前将其删除:

    df.reset_index(drop=True, inplace=True)
    

    这样就完成了工作。

    猜你喜欢
    • 2017-02-18
    • 1970-01-01
    • 1970-01-01
    • 2016-06-27
    • 1970-01-01
    • 1970-01-01
    • 2016-06-29
    • 1970-01-01
    • 2016-10-16
    相关资源
    最近更新 更多