Re: Numeric N-dimensional array initialization

2006-06-22 Thread TG
Thanks for your precious advices. The flat iterator is definitely what i need. -- http://mail.python.org/mailman/listinfo/python-list

Re: Numeric N-dimensional array initialization

2006-06-22 Thread Robert Kern
TG wrote: > I tried to use Numeric.fromfunction, but there seems to be a problem : > > the function called must have the right number of args (hint : the > number of dimensions, which I don't know). So i tried to use a function > like : > > def myfunc(*args, **kw): > return 0 > > and then i

Re: Numeric N-dimensional array initialization

2006-06-22 Thread Robert Kern
TG wrote: > Hi there ! > > I'm just starting to use Numeric here, and I'm wondering : how can I > efficiently initialize every values of a N-dimensional array, given I > don't know the number of dimensions ? > > I'm looking for something like a map function, or a way to conveniently > iterate thr

Re: Numeric N-dimensional array initialization

2006-06-22 Thread TG
I tried to use Numeric.fromfunction, but there seems to be a problem : the function called must have the right number of args (hint : the number of dimensions, which I don't know). So i tried to use a function like : def myfunc(*args, **kw): return 0 and then i get : >> Numeric.fromfunctio

Numeric N-dimensional array initialization

2006-06-22 Thread TG
Hi there ! I'm just starting to use Numeric here, and I'm wondering : how can I efficiently initialize every values of a N-dimensional array, given I don't know the number of dimensions ? I'm looking for something like a map function, or a way to conveniently iterate through the whole N-array, bu