Scipy.stats.anderson返回一个数组而不是浮点数,如文档中所述

时间:2017-10-31 15:13:05

标签: python numpy scipy

我试图使用Anderson-Darling方法测试我的残差是否遵循正常分布使用Scipy.stats.anderson,我在Linux环境中使用Scipy v1.0.0,Python3.5。

但是,如文档中所述,不是返回测试统计信息的浮点数,而是返回一个数组。

我的输入是一维numpy数组。以下是输出。

感谢您的帮助!

AndesonResults from Scipy.stats.anderson

1 个答案:

答案 0 :(得分:0)

尝试:

results = anderson(rez.flatten(), dist='norm')

我认为问题是您的rez形状为(n,1)而不是(n,)anderson代码预计1d数组。