[Numpy-discussion] take semantics (bug?)

Michael McNeil Forbes mforbes at phys.washington.edu
Mon Dec 4 00:27:08 EST 2006


What are the semantics of the "take" function?

I would have expected that the following have the same shape and size:

>>> a = array([1,2,3])
>>> inds = a.nonzero()
>>> a[inds]
array([1, 2, 3])
>>> a.take(inds)
array([[1, 2, 3]])

Is there a bug somewhere here or is this intentional?

Michael.




More information about the NumPy-Discussion mailing list