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 should

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 functionality

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 charlesr.har...@gmail.com 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

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

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 andrew_gies...@hms.harvard.edu 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

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

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 jason-s...@creativetrax.com wrote: On

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

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 Matthew Brett
Hi, On Fri, Apr 26, 2013 at 10:02 AM, Andrew Giessel andrew_gies...@hms.harvard.edu 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

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 over

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 robert.k...@gmail.com wrote: On Wed, Apr 24, 2013 at 10:37 PM, andrew giessel andrew.gies...@gmail.com wrote: Hello all- A while back I emailed the list about function for the numpy namespace, iteraxis(), which allows you to generalize the

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 matthew.br...@gmail.com wrote: Hi, On Thu, Apr 25, 2013 at 10:14 AM, Robert Kern robert.k...@gmail.com wrote: On Wed, Apr 24, 2013 at 10:37 PM, andrew giessel andrew.gies...@gmail.com wrote: Hello all- A while back I emailed the list about

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 robert.k...@gmail.com wrote: On Thu, Apr 25, 2013 at 6:30 PM, Matthew Brett matthew.br...@gmail.com wrote: Hi, On Thu, Apr 25, 2013 at 10:14 AM, Robert Kern robert.k...@gmail.com wrote: On Wed, Apr 24, 2013 at 10:37 PM, andrew giessel

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 matthew.br...@gmail.com wrote: Hi, On Thu, Apr 25, 2013 at 10:42 AM, Robert Kern robert.k...@gmail.com wrote: On Thu, Apr 25, 2013 at 6:30 PM, Matthew Brett matthew.br...@gmail.com wrote: So the decision has to be based on some estimate of:

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 8:21 PM, Andrew Giessel andrew_gies...@hms.harvard.edu 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

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 robert.k...@gmail.com wrote: On Thu, Apr 25, 2013 at 8:21 PM, Andrew Giessel andrew_gies...@hms.harvard.edu wrote: I respect this opinion. However (and maybe this is legacy), while reading through the numeric.py source file, I was surprised at how

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

2013-04-25 Thread Charles R Harris
On Thu, Apr 25, 2013 at 1:51 PM, josef.p...@gmail.com wrote: On Thu, Apr 25, 2013 at 3:40 PM, Robert Kern robert.k...@gmail.com wrote: On Thu, Apr 25, 2013 at 8:21 PM, Andrew Giessel andrew_gies...@hms.harvard.edu wrote: I respect this opinion. However (and maybe this is legacy), while

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, josef.p...@gmail.com wrote: On Thu, Apr 25, 2013 at 3:40 PM, Robert Kern robert.k...@gmail.com wrote: On Thu, Apr 25, 2013 at 8:21 PM, Andrew Giessel

[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: