我正在使用SciPy的
pearsonr(x,y)
方法,但我无法弄清为什么会出现以下错误:ValueError: shape mismatch: objects cannot be broadcast to a single shape
它计算了前两个(我正在循环中运行数千个这些测试),然后就停止了。有人对问题可能是什么有任何想法吗?
r_num = n*(np.add.reduce(xm*ym))
这是出现错误的pearsonr
方法中的那一行。