pandas: find percentile stats of a given column

后端 未结 4 1484
不思量自难忘°
不思量自难忘° 2020-12-04 19:16

I have a pandas data frame my_df, where I can find the mean(), median(), mode() of a given column:

my_df[\'field_A\'].mean()
my_df[\'field_A\'].median()
my_d         


        
4条回答
  •  离开以前
    2020-12-04 19:55

    You can even give multiple columns with null values and get multiple quantile values (I use 95 percentile for outlier treatment)

    my_df[['field_A','field_B']].dropna().quantile([0.0, .5, .90, .95])
    

提交回复
热议问题