map

Giorgi Lekishvili gleki at gol.ge
Fri Jun 7 06:51:24 EDT 2002


Ok, there is a function in Numeric, and Numeric.power(a, y) works as
expected.

Anyway, I still would like to know wether there's an opportunity to employ
map function as stated.

Giorgi Lekishvili wrote:

> Hi all!
>
> Is there a way to map a function with several arguments to a list? E.g.,
>
> >>>import math
> >>>import MLab
> >>>a=MLab.rand(3,5)
> >>>b=map(math.pow,a)
>
> of course, this doesn't work.
>
> What to do? My task is to optimize the power (i.e., y in pow(x,y)) to
> achieve maximal performance.
>
> thanx,
> Giorgi
>
> PS: Perhaps I have missed the needed functionality, that's presented in
> NumPy?




More information about the Python-list mailing list