为什么胡须不等于分位数?

时间:2017-04-21 22:52:06

标签: python pandas statistics plotly

我不确定这实际上是不是一个数学问题,但为什么没有情节箱形图胡须等于熊猫数据框架方法quantile(0.01)(0.99)或类似?原因绝不是,分位数参数不匹配,因为一些计算结果较高而其他计算结果较低。 THX

for col in df.columns:

    data.append(  go.Box( y=df[col], name=getclearname(col), showlegend=False, boxmean='sd' ) )
    df.rename(columns = {col:getclearname(col)}, inplace = True)
    df=df.fillna(100)
    #print(df)
data.append( go.Scatter( x = df.columns, y = df.median(), mode='marker', name='median' ) )
data.append( go.Scatter( x = df.columns, y = df.quantile(0.25), mode='marker', name='lower quantile' ) )
data.append( go.Scatter( x = df.columns, y = df.quantile(0.75), mode='marker', name='upper quantile' ) )
data.append( go.Scatter( x = df.columns, y = df.fillna(100).quantile(0.01), mode='marker', name='lower percentile' ) )
data.append( go.Scatter( x = df.columns, y = df.fillna(100).quantile(0.99), mode='marker', name='upper percentile' ) )
layout=go.Layout(title=""+cata+" - local spatial properties on placements<br>"+constraintdesc,yaxis=dict(
    title='percentage of range between flat extremes'))
fig = go.Figure(data=data, layout=layout)
py.offline.iplot(fig, filename='pandas-box-plot')

导致以下奇怪的行为: downloaded plot from notebook

0 个答案:

没有答案