I agree with Charles that rollaxis() isn't immediately intuitive. It seems to me that documentation like this doesn't belong in rollaxis() but instead wherever people talk about indexing and/or iterating over an array. Nothing about the iteration depends on rollaxis(), rollaxis is just giving you a different view of the array to call __getitem__() on, if I understand correctly.
I'm counting 2 for (Me, Charles), 2 against (Robert, Josef), and two or three neutral parties (based on interest/comments: Matthew, Sebastian, and Phil Elson (who commented on the PR)). I don't know how to best proceed from here. Best, Andrew On Fri, Apr 26, 2013 at 5:42 AM, Robert Kern <[email protected]> wrote: > On Thu, Apr 25, 2013 at 9:04 PM, Charles R Harris > <[email protected]> wrote: > > > After thinking about it, I'm in favor of this small function. Rollaxis > takes > > a bit of thought and document reading to figure out how to use it, > whereas > > this function covers a common use with an easy to understand API. > > It seems to me that just an additional example in the rollaxis() > docstring solves that problem: > > ``rollaxis()`` can be used to iterate over a given axis of a > multidimensional array: > > >>> for x in np.rollaxis(a, 2): > ... print x.shape > ... > (3, 4, 6) > (3, 4, 6) > (3, 4, 6) > (3, 4, 6) > (3, 4, 6) > > -- > Robert Kern > _______________________________________________ > NumPy-Discussion mailing list > [email protected] > http://mail.scipy.org/mailman/listinfo/numpy-discussion > -- Andrew Giessel, PhD Department of Neurobiology, Harvard Medical School 220 Longwood Ave Boston, MA 02115 ph: 617.432.7971 email: [email protected]
_______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
