[Numpy-discussion] Iterate over all 1-dim views

Neal Becker ndbecker2 at gmail.com
Sun Oct 7 06:52:11 EDT 2007


Suppose I have a function F(), which is defined for 1-dim arguments.  If the
user passes an n>1 dim array, I want to apply F to each 1-dim view.

For example, for a 2-d array, apply F to each row and return a 2-d result.

For a 3-d array, select each 2-d subarray and see above.  Return 3-d result.

Any suggestions on how to code something like this in numpy?




More information about the NumPy-Discussion mailing list