On 8/26/06, Travis Oliphant <[EMAIL PROTECTED]> wrote:

I've come up with adding the functions (not methods at this point)

deletefrom
insertinto

"delete" and "insert" really would be better.   The current "insert" function seems inaptly named.  What it does sounds more like "overlay" or "set_masked".

... or the existing "putmask" which I see does a similar thing.

Actually there seems to be a little doc-bug there or something.  numpy.insert claims it differs from putmask in that it only accepts a vector of values with same number of vals as the # of non-zero entries in the mask, but a quick test revals it's quite happy with a different number and cycles through them.

In [31]: a = numpy.zeros((3,3))
In [32]: numpy.insert(a, [[0,1,0],[1,0,0],[1,0,0]], [4,5])
In [33]: a
Out[33]:
array([[ 0.,  4.,  0.],
       [ 5.,  0.,  0.],
       [ 4.,  0.,  0.]])

Anyway, in the end nothing has really been inserted, existing entries have just been replaced.

So "insert" seems like a much better name for a function that actually puts in a new row or column.

--bb
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to