[Numpy-discussion] take semantics (bug?)

Michael McNeil Forbes mforbes at phys.washington.edu
Sun Dec 3 23:27:08 CST 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