梦书之家(移动开发)

你有一个苹果,我有一个苹果,我们交换一下,一人还是一个苹果;你有一个思想,我有一个思想,我们交换一下,一人就有两个思想。 ——肖伯纳

导航

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

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

 

这是为啥啊

 

环境如下:

 

posted on 2018-03-19 15:05  梦书  阅读(964)  评论(2编辑  收藏  举报