【问题标题】:Python pandas: calculate the statistical range for all the columns.Python pandas:计算所有列的统计范围。
【发布时间】:2018-09-13 22:04:02
【问题描述】:

使用 python pandas,我有一个包含一些 int 类型列的数据框。我需要计算所有列的统计范围。我能够计算每列的最小值和最大值,但不知道如何计算所有列的范围

【问题讨论】:

标签: pandas


【解决方案1】:

您可以查看describe

df.describe(include='int64')
Out[10]: 
            cost      value
count   2.000000   2.000000
mean   20.500000  25.000000
std     7.778175   7.071068
min    15.000000  20.000000
25%    17.750000  22.500000
50%    20.500000  25.000000
75%    23.250000  27.500000
max    26.000000  30.000000

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-09-20
    • 2018-03-19
    • 2014-09-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多