如何在pandas中添加属性来描述()?

时间:2019-11-25 13:50:04

标签: python-3.x pandas dataframe attributes describe

df.describe().loc[['mean','std','25%','50%','75%']]

如何在describe()函数的默认输出属性中添加其他属性,例如10%和90%百分位数?

1 个答案:

答案 0 :(得分:0)

DataFrame.describe中使用参数percentiles

  

百分位数:类似数字的列表,可选
  要包含在输出中的百分比。所有值都应介于0和1之间。默认值为[.25,.5,.75],它返回第25、50和75个百分位数。

df.describe(percentiles=[.1, .25, .5, .75, .9])