[MATRIX-SIG] reverse of take?

Aaron Watters arw@dante.mh.lucent.com
Thu, 26 Jun 1997 16:15:45 -0400


Okay, stupid question time.

(I think I just subscribed, assuming the mail address I used
made sense... actually I thought I'd subscribed before, but
there ya go...)

Been fiddling with numeric recently and I can't seem
to find or derive an "inverse" to take.  Ie, I'd like a
builtin that will set a collection of values scattered about
inside an array.

Ie, I want to draw a circle on a large array of 0 bytes
(without making another large array).  solution: compute
the array of indices for the circle and set all the indices
to one.  Might look something like this:

set_by_indices (big_byte_array, indices, 1)

Does the equivalent of

for pair in indices:
    big_byte_array(pair[0], pair[1]) = 1

but without the Python overhead.

or whatever.  Sorry if this kinda thing
is already there.  Please educate me.  -- Aaron Watters


_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________