[Numpy-tickets] [NumPy] #1025: Incorrect documentation for put function
NumPy
numpy-tickets@scipy....
Tue Feb 24 14:21:00 CST 2009
#1025: Incorrect documentation for put function
------------------------+---------------------------------------------------
Reporter: afoglia | Owner: somebody
Type: defect | Status: new
Priority: normal | Milestone: 1.3.0
Component: numpy.core | Version: none
Severity: minor | Keywords: put documentation
------------------------+---------------------------------------------------
The documentation for the put method is incorrect. In particular the
psuedocode should read
ind = array(indices, copy=False)
vals = array(values, copy=False).astype(a.dtype)
for i, v in zip(ind,vals): a.flat[i] = v
In particular, it's the last line. The i-th element of the array a is not
filled with the i-th element of the values array, but the value that is
next in the values array.
If the documentation were correct as written, then a.put(indices,
values)[indices] == values would not be guaranteed (up to nans).
http://docs.scipy.org/doc/numpy/reference/generated/numpy.put.html#numpy.put
--
Ticket URL: <http://scipy.org/scipy/numpy/ticket/1025>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.
More information about the Numpy-tickets
mailing list