[Numpy-discussion] ufuncs question

Pau Gargallo pau.gargallo at gmail.com
Thu Feb 9 06:44:01 EST 2006

hi all,
i have a code the following code:

def foo(x):
    '''takes a nd-array x and return another md-array'''
    do something
    return a md-array

A = an array of nd-arrays #A has 1+n dimensions
B = an array of md-arrays #B has 1+m dimensions
for i in len(A):
    B[i] = foo(A[i])

and was wandering if there is an easy way to speed it up. I guess that
something using ufuncs could be used (?). Something like B =
ufunced_foo( A ).
thanks in advance,


More information about the NumPy-Discussion mailing list