Mann Whitney对大型数据集进行测试会在python

时间:2016-09-15 12:32:03

标签: scipy python-3.5

我想在两个10,000和100,000个数字列表上运行Mann Whitney U测试。使用python我可以使用scipy.stats运行测试:

from scipy.stats import mannwhitneyu
mann_u=mannwhitneyu([1,2,3,4],[5,6,7,8])

没有任何问题。但是当我在大数据上使用此代码时,它会返回以下错误:

from random import randint
x=[randint(0,9) for p in range(0,100000)]
y=[randint(0,9) for p in range(0,100000)]
mannwhitneyu(x,y)
C:\Anaconda3\lib\site-packages\scipy\stats\stats.py:4630: RuntimeWarning: invalid value encountered in sqrt
sd = np.sqrt(T * n1 * n2 * (n1+n2+1) / 12.0)
C:\Anaconda3\lib\site-packages\scipy\stats\_distn_infrastructure.py:1748:  RuntimeWarning: invalid value encountered in greater
cond1 = (scale > 0) & (x > self.a) & (x < self.b)
C:\Anaconda3\lib\site-packages\scipy\stats\_distn_infrastructure.py:1748: RuntimeWarning: invalid value encountered in less
cond1 = (scale > 0) & (x > self.a) & (x < self.b)
C:\Anaconda3\lib\site-packages\scipy\stats\_distn_infrastructure.py:1749: RuntimeWarning: invalid value encountered in less_equal
cond2 = cond0 & (x <= self.a)
Out[66]: MannwhitneyuResult(statistic=4995054086.5, pvalue=nan)

有什么建议吗?

0 个答案:

没有答案