Numpy: inverse of take?

Boncelet Charles boncelet at ee.adfa.edu.au
Thu Feb 24 23:22:30 EST 2000


I want to do the following in numpy:

#i=large data file (a digital image converted from PIL)
#l = list of pixels in which I am interested
p = take(i,l) #extracts the pixels I want

#(do something with these pixels, then)
i = inverse_take(i,p,l) #put them back where they were

This is the step I can't figure out.  Obviously I can do it
with a simple python loop, but i and l are big and I'd like to
do it quickly. (The python loop may be quick enough anyway, but out of
principal, I like to avoid python loops when doing numpy work.)

Any suggestions?

------
Charles Boncelet, University of Delaware, <boncelet at udel.edu>
On sabbatical at ADFA, Canberra Australia, <boncelet at ee.adfa.edu.au>
Home Page: http://www.ece.udel.edu/~boncelet/



More information about the Python-list mailing list