sciPy stats.percentileofscore()| Python

| | | | | | | | |

xパーセンタイルが60%であると仮定します。これは、aのスコアの80%がx未満であることを意味します。

パラメーター:
arr:[array_like]入力配列。
スコア:[intまたはfloat]配列内の要素と比較したスコア。
種類: [オプション]`rank`、`weak`、`strict`、`mean`。

結果:配列要素に対するスコアのパーセンタイル。

コード#1:


#%

from scipy import stats

import numpy as np


#1D配列

arr = [ 20 2 7 1 7 7 34 ]

print "arr:" 、arr)


print "Percetile of 7:" 、stats.percentileofscore(arr、 7 ))


print "Percetile of 34:" 、stats.percentileofscore (arr、 34 ))


印刷 " Percetile of 2: " 、stats.percentileofscore (arr、 2 ))

終了:

 arr:[20、2、7、1、7、7、34] 7のPercetile:57.1428571429 34のPercetile:100.0 2のPercetile:28.5714285714