[Numpy-discussion] Axis Iterator?

2006-09-14 Thread Brendan Simons
Hi all, Just wondering if there was an arbitrary axis iterator in numpy, or if not, if there's demand for one. What I'm looking for is something which would allow me to do something like (vectorFunc(column) for column in array.axisIter(1) ) without a bunch of for loops and slicing. Thoug

Re: [Numpy-discussion] Axis Iterator?

2006-09-14 Thread Brendan Simons
Oh that's cool.  For some reason I thought that the built in iterator (for i in array) iterated over cells, not the first axis.  I also didn't think about swapaxes.    Is there any desire to add a convenience function or method as follows?def axisIter(selfOrArr, i): return iter(selfOrArr.swapAxes(0