Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-05-01 Thread Benjamin Root
On Mon, Apr 29, 2013 at 2:10 PM, Andrew Giessel < andrew_gies...@hms.harvard.edu> wrote: > Matthew: Thanks for the link to array order discussion. > > Any more thoughts on Phil's slice() function? > > > I rather like Phil's solution. Just some caveats. Will it always return views or copies? It

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-29 Thread Andrew Giessel
Matthew: Thanks for the link to array order discussion. Any more thoughts on Phil's slice() function? On Fri, Apr 26, 2013 at 4:50 PM, Gael Varoquaux < gael.varoqu...@normalesup.org> wrote: > On Thu, Apr 25, 2013 at 08:10:32PM +0100, Robert Kern wrote: > > In my opinion, duplicating functional

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-26 Thread Gael Varoquaux
On Thu, Apr 25, 2013 at 08:10:32PM +0100, Robert Kern wrote: > In my opinion, duplicating functionality under different aliases just > so people can supposedly find things without reading the documentation > is not a viable strategy for building out an API. +1. It's been my experience over and ove

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-26 Thread Matthew Brett
Hi, On Fri, Apr 26, 2013 at 10:02 AM, Andrew Giessel wrote: > I like this, thank you Phil. > > From what I can see, the ordering of the returned slices when you use more > than one axis (ie: slices(a, [1,2]), increments the last axis fastest. Does > this makes sense based on the default ordering

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-26 Thread Andrew Giessel
I like this, thank you Phil. >From what I can see, the ordering of the returned slices when you use more than one axis (ie: slices(a, [1,2]), increments the last axis fastest. Does this makes sense based on the default ordering of, say, nditer()? I know that C-order (row major) and Fortran order

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-26 Thread Phil Elson
I didn't find the rollaxis solution particularly obvious and also had to think about what rollaxis did before understanding its usefulness for iteration. Now that I've understood it, I'm +1 for the statement that, as it stands, the proposed iteraxis method doesn't add enough to warrant its inclusio

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-26 Thread josef . pktd
the "new" documentation http://stackoverflow.com/questions/1589706/iterating-over-arbitrary-dimension-of-numpy-array second answer, 1st answer is what I usually use search term "[numpy] iterate over axis" Josef On Fri, Apr 26, 2013 at 9:37 AM, Jason Grout wrote: > On 4/26/13 6:33 AM, Robert K

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-26 Thread Jason Grout
On 4/26/13 6:33 AM, Robert Kern wrote: > In any case, whether you put the documentation in the rollaxis() > docstring or in one of the indexing/iteration sections, or > (preferably) both, I strongly encourage you to do that first and see > how it goes before adding a new alias. +1 (for what it's w

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-26 Thread Robert Kern
On Fri, Apr 26, 2013 at 12:26 PM, Andrew Giessel wrote: > 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

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-26 Thread Andrew Giessel
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 yo

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-26 Thread Robert Kern
On Thu, Apr 25, 2013 at 9:04 PM, Charles R Harris 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

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-25 Thread Sebastian Berg
On Thu, 2013-04-25 at 14:04 -0600, Charles R Harris wrote: > > > On Thu, Apr 25, 2013 at 1:51 PM, wrote: > On Thu, Apr 25, 2013 at 3:40 PM, Robert Kern > wrote: > > On Thu, Apr 25, 2013 at 8:21 PM, Andrew Giessel > > wrote: > >> I respect this opinion.

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-25 Thread Charles R Harris
On Thu, Apr 25, 2013 at 1:51 PM, wrote: > On Thu, Apr 25, 2013 at 3:40 PM, Robert Kern > wrote: > > On Thu, Apr 25, 2013 at 8:21 PM, Andrew Giessel > > wrote: > >> I respect this opinion. However (and maybe this is legacy), while > reading > >> through the numeric.py source file, I was surpris

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-25 Thread josef . pktd
On Thu, Apr 25, 2013 at 3:40 PM, Robert Kern wrote: > On Thu, Apr 25, 2013 at 8:21 PM, Andrew Giessel > wrote: >> I respect this opinion. However (and maybe this is legacy), while reading >> through the numeric.py source file, I was surprised at how short many of the >> functions are, generally.

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-25 Thread Robert Kern
On Thu, Apr 25, 2013 at 8:21 PM, Andrew Giessel wrote: > I respect this opinion. However (and maybe this is legacy), while reading > through the numeric.py source file, I was surprised at how short many of the > functions are, generally. Functions like ones() and zeros() are pretty > simple wrap

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-25 Thread Andrew Giessel
I respect this opinion. However (and maybe this is legacy), while reading through the numeric.py source file, I was surprised at how short many of the functions are, generally. Functions like ones() and zeros() are pretty simple wrappers which call empty() and then copy over values. FWIW, I had

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-25 Thread Robert Kern
On Thu, Apr 25, 2013 at 6:54 PM, Matthew Brett wrote: > Hi, > > On Thu, Apr 25, 2013 at 10:42 AM, Robert Kern wrote: >> On Thu, Apr 25, 2013 at 6:30 PM, Matthew Brett >> wrote: >>> So the decision has to be based on some estimate of: >>> >>> 1) Cost for adding a new function to the namespace >

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-25 Thread Matthew Brett
Hi, On Thu, Apr 25, 2013 at 10:42 AM, Robert Kern wrote: > On Thu, Apr 25, 2013 at 6:30 PM, Matthew Brett > wrote: >> Hi, >> >> On Thu, Apr 25, 2013 at 10:14 AM, Robert Kern wrote: >>> On Wed, Apr 24, 2013 at 10:37 PM, andrew giessel >>> wrote: Hello all- A while back I emailed

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-25 Thread Robert Kern
On Thu, Apr 25, 2013 at 6:30 PM, Matthew Brett wrote: > Hi, > > On Thu, Apr 25, 2013 at 10:14 AM, Robert Kern wrote: >> On Wed, Apr 24, 2013 at 10:37 PM, andrew giessel >> wrote: >>> Hello all- >>> >>> A while back I emailed the list about function for the numpy namespace, >>> iteraxis(), which

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-25 Thread Matthew Brett
Hi, On Thu, Apr 25, 2013 at 10:14 AM, Robert Kern wrote: > On Wed, Apr 24, 2013 at 10:37 PM, andrew giessel > wrote: >> Hello all- >> >> A while back I emailed the list about function for the numpy namespace, >> iteraxis(), which allows you to generalize the default iteration behavior of >> nump

Re: [Numpy-discussion] Proposal of new function: iteraxis()

2013-04-25 Thread Robert Kern
On Wed, Apr 24, 2013 at 10:37 PM, andrew giessel wrote: > Hello all- > > A while back I emailed the list about function for the numpy namespace, > iteraxis(), which allows you to generalize the default iteration behavior of > numpy arrays over any axis. > > I've implemented this function more clea

[Numpy-discussion] Proposal of new function: iteraxis()

2013-04-24 Thread andrew giessel
Hello all- A while back I emailed the list about function for the numpy namespace, iteraxis(), which allows you to generalize the default iteration behavior of numpy arrays over any axis. I've implemented this function more cleanly and the pull request is here: https://github.com/numpy/numpy/pull