ValueError: output parameter for reduction operation logical_and has too many dimensions ?

夢書發表於2018-03-19

https://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.all.html#numpy.all

執行示例,卻發生錯誤

import numpy as np

o = np.array([False])
z = np.all([-1,4,5], out=o)

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/numpy/core/fromnumeric.py", line 2098, in all
return arr.all(axis=axis, out=out, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/numpy/core/_methods.py", line 41, in _all
return umr_all(a, axis, dtype, out, keepdims)
ValueError: output parameter for reduction operation logical_and has too many dimensions

 

這是為啥啊

 

環境如下:

 

相關文章