本文簡要介紹 python 語言中 scipy.stats.mstats.zmap
的用法。
用法:
scipy.stats.mstats.zmap(scores, compare, axis=0, ddof=0, nan_policy='propagate')#
計算相對z-scores。
返回 z-scores 的數組,即標準化為零均值和單位方差的分數,其中均值和方差是從比較數組計算的。
- scores: array_like
計算z-scores 的輸入。
- compare: array_like
取歸一化的均值和標準差的輸入;假設與分數具有相同的維度。
- axis: int 或無,可選
計算比較平均值和方差的軸。默認值為 0。如果沒有,則計算整個數組的分數。
- ddof: 整數,可選
計算標準偏差時的自由度校正。默認值為 0。
- nan_policy: {‘propagate’, ‘raise’, ‘omit’},可選
定義如何處理比較中出現的 nan。 ‘propagate’ 返回 nan,‘raise’ 引發異常,‘omit’ 執行忽略 nan 值的計算。默認為‘propagate’。請注意,當值為 ‘omit’ 時,分數中的 nan 也會傳播到輸出,但它們不會影響為非 nan 值計算的 z-scores。
- zscore: array_like
Z-scores,形狀與分數相同。
參數 ::
返回 ::
注意:
此函數保留 ndarray 子類,也適用於矩陣和掩碼數組(它使用 asanyarray 而不是 asarray 作為參數)。
例子:
>>> from scipy.stats import zmap >>> a = [0.5, 2.0, 2.5, 3] >>> b = [0, 1, 2, 3, 4] >>> zmap(a, b) array([-1.06066017, 0. , 0.35355339, 0.70710678])
相關用法
- Python SciPy mstats.zscore用法及代碼示例
- Python SciPy mstats.trim用法及代碼示例
- Python SciPy mstats.winsorize用法及代碼示例
- Python SciPy mstats.argstoarray用法及代碼示例
- Python SciPy mstats.trima用法及代碼示例
- Python SciPy mstats.tmin用法及代碼示例
- Python SciPy mstats.tmax用法及代碼示例
- Python SciPy mstats.kruskalwallis用法及代碼示例
- Python SciPy mstats.sem用法及代碼示例
- Python SciPy mstats.mode用法及代碼示例
- Python SciPy mstats.hmean用法及代碼示例
- Python SciPy mstats.variation用法及代碼示例
- Python SciPy mstats.compare_medians_ms用法及代碼示例
- Python SciPy mstats.gmean用法及代碼示例
- Python SciPy mstats.pearsonr用法及代碼示例
- Python SciPy mstats.kruskal用法及代碼示例
- Python SciPy mstats.tmean用法及代碼示例
- Python SciPy mstats.mquantiles用法及代碼示例
- Python SciPy mstats.count_tied_groups用法及代碼示例
- Python SciPy mstats.chisquare用法及代碼示例
- Python SciPy mstats.describe用法及代碼示例
- Python SciPy mstats.sen_seasonal_slopes用法及代碼示例
- Python SciPy mstats.find_repeats用法及代碼示例
- Python SciPy matlab.loadmat用法及代碼示例
- Python SciPy misc.ascent用法及代碼示例
注:本文由純淨天空篩選整理自scipy.org大神的英文原創作品 scipy.stats.mstats.zmap。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。