[Numpy-discussion] amap: new function / ufunc method?

Travis Oliphant oliphant.travis at ieee.org
Sun Jan 27 22:10:04 CST 2002


> In the process of 'porting' Konrad Hinsen's Histogram class (from the
> Scientific package) to N dimensions, I ran across the problem of how to
> apply a function to an array for a specified set of indices. 

If I understand what you are trying to do, there is a function called 
arraymap in the SciPy package (special module) (it was in the Numeric source 
for a short time but I think we decided to take it out --- I can't remember 
why).

I think that using this function and a combination of take and put can do 
what you describe.

It is available as scipy.special.arraymap

Best regards,

Travis Oliphant




More information about the Numpy-discussion mailing list