借助statsmodels.robust_skewness()
方法,我們可以計算Kim&White中的四個偏度度量。
用法:statsmodels.robust_skewness(array, axis)
返回:Return the four skewness measures value.
範例1:
在這個例子中,我們可以通過使用statsmodels.robust_skewness()
方法,我們可以使用此方法獲得四個偏度度量的值。
# import numpy and statsmodels
import numpy as np
from statsmodels.stats.stattools import robust_skewness
g = np.array([1, 2, 3, 4, 7, 8])
# Using statsmodels.robust_skewness() method
gfg = medcouple(g)
print(gfg)
輸出:
0.2857142857142857
範例2:
# import numpy and statsmodels
import numpy as np
from statsmodels.stats.stattools import robust_skewness
g = np.array([1, 2, 8, 9, 10])
# Using statsmodels.robust_skewness() method
gfg = medcouple(g)
print(gfg)
輸出:
-0.5555555555555556
相關用法
注:本文由純淨天空篩選整理自Jitender_1998大神的英文原創作品 statsmodels.robust_skewness() in python。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。