Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-17 Thread josef.pktd
On Thu, Oct 16, 2014 at 10:50 PM, Nathaniel Smith wrote: > On Fri, Oct 17, 2014 at 2:35 AM, wrote: >> On Thu, Oct 16, 2014 at 3:39 PM, Nathaniel Smith wrote: >>> On Thu, Oct 16, 2014 at 6:30 PM, Warren Weckesser >>> wrote: On Thu, Oct 16, 2014 at 12:40 PM, Nathaniel Smith wrote

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-16 Thread Nathaniel Smith
On Fri, Oct 17, 2014 at 2:35 AM, wrote: > On Thu, Oct 16, 2014 at 3:39 PM, Nathaniel Smith wrote: >> On Thu, Oct 16, 2014 at 6:30 PM, Warren Weckesser >> wrote: >>> >>> >>> On Thu, Oct 16, 2014 at 12:40 PM, Nathaniel Smith wrote: On Thu, Oct 16, 2014 at 4:39 PM, Warren Weckesser

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-16 Thread josef.pktd
On Thu, Oct 16, 2014 at 3:39 PM, Nathaniel Smith wrote: > On Thu, Oct 16, 2014 at 6:30 PM, Warren Weckesser > wrote: >> >> >> On Thu, Oct 16, 2014 at 12:40 PM, Nathaniel Smith wrote: >>> >>> On Thu, Oct 16, 2014 at 4:39 PM, Warren Weckesser >>> wrote: >>> > >>> > On Sun, Oct 12, 2014 at 9:13 PM

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-16 Thread Nathaniel Smith
On Thu, Oct 16, 2014 at 6:30 PM, Warren Weckesser wrote: > > > On Thu, Oct 16, 2014 at 12:40 PM, Nathaniel Smith wrote: >> >> On Thu, Oct 16, 2014 at 4:39 PM, Warren Weckesser >> wrote: >> > >> > On Sun, Oct 12, 2014 at 9:13 PM, Nathaniel Smith wrote: >> >> >> >> Regarding names: shuffle/permut

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-16 Thread Warren Weckesser
On Thu, Oct 16, 2014 at 12:40 PM, Nathaniel Smith wrote: > On Thu, Oct 16, 2014 at 4:39 PM, Warren Weckesser > wrote: > > > > On Sun, Oct 12, 2014 at 9:13 PM, Nathaniel Smith wrote: > >> > >> Regarding names: shuffle/permutation is a terrible naming convention > >> IMHO and shouldn't be propaga

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-16 Thread Nathaniel Smith
On Thu, Oct 16, 2014 at 4:39 PM, Warren Weckesser wrote: > > On Sun, Oct 12, 2014 at 9:13 PM, Nathaniel Smith wrote: >> >> Regarding names: shuffle/permutation is a terrible naming convention >> IMHO and shouldn't be propagated further. We already have a good >> naming convention for inplace-vs-s

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-16 Thread Jaime Fernández del Río
On Thu, Oct 16, 2014 at 8:39 AM, Warren Weckesser < warren.weckes...@gmail.com> wrote: > > > On Sun, Oct 12, 2014 at 9:13 PM, Nathaniel Smith wrote: > >> On Sun, Oct 12, 2014 at 5:14 PM, Sebastian wrote: >> > >> > On 2014-10-12 16:54, Warren Weckesser wrote: >> >> >> >> >> >> On Sun, Oct 12, 201

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-16 Thread Warren Weckesser
On Sun, Oct 12, 2014 at 9:13 PM, Nathaniel Smith wrote: > On Sun, Oct 12, 2014 at 5:14 PM, Sebastian wrote: > > > > On 2014-10-12 16:54, Warren Weckesser wrote: > >> > >> > >> On Sun, Oct 12, 2014 at 7:57 AM, Robert Kern >> > wrote: > >> > >> On Sat, Oct 11, 20

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread Nathaniel Smith
On Sun, Oct 12, 2014 at 5:14 PM, Sebastian wrote: > > On 2014-10-12 16:54, Warren Weckesser wrote: >> >> >> On Sun, Oct 12, 2014 at 7:57 AM, Robert Kern > > wrote: >> >> On Sat, Oct 11, 2014 at 11:51 PM, Warren Weckesser >> mailto:warren.weckes...@gmail.com>>

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread Stephan Hoyer
On Sun, Oct 12, 2014 at 10:56 AM, Jaime Fernández del Río < jaime.f...@gmail.com> wrote: > > Just to add some noise to a productive conversation: if you add a 'copy' > flag to shuffle, then all the functionality is in one place, and > 'permutation' can either be deprecated, or trivially implemented

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread Jaime Fernández del Río
On Sun, Oct 12, 2014 at 9:29 AM, Warren Weckesser < warren.weckes...@gmail.com> wrote: > > > On Sun, Oct 12, 2014 at 12:14 PM, Warren Weckesser < > warren.weckes...@gmail.com> wrote: > >> >> >> On Sat, Oct 11, 2014 at 6:51 PM, Warren Weckesser < >> warren.weckes...@gmail.com> wrote: >> >>> I creat

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread Warren Weckesser
On Sun, Oct 12, 2014 at 12:14 PM, Warren Weckesser < warren.weckes...@gmail.com> wrote: > > > On Sat, Oct 11, 2014 at 6:51 PM, Warren Weckesser < > warren.weckes...@gmail.com> wrote: > >> I created an issue on github for an enhancement >> to numpy.random.shuffle: >> https://github.com/numpy/nu

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread josef.pktd
On Sun, Oct 12, 2014 at 12:14 PM, Warren Weckesser wrote: > > > On Sat, Oct 11, 2014 at 6:51 PM, Warren Weckesser > wrote: >> >> I created an issue on github for an enhancement >> to numpy.random.shuffle: >> https://github.com/numpy/numpy/issues/5173 >> I'd like to get some feedback on the id

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread Sebastian
On 2014-10-12 16:54, Warren Weckesser wrote: > > > On Sun, Oct 12, 2014 at 7:57 AM, Robert Kern > wrote: > > On Sat, Oct 11, 2014 at 11:51 PM, Warren Weckesser > mailto:warren.weckes...@gmail.com>> > wrote: > > > A small wart in this API is the meanin

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread Warren Weckesser
On Sat, Oct 11, 2014 at 6:51 PM, Warren Weckesser < warren.weckes...@gmail.com> wrote: > I created an issue on github for an enhancement > to numpy.random.shuffle: > https://github.com/numpy/numpy/issues/5173 > I'd like to get some feedback on the idea. > > Currently, `shuffle` shuffles the fi

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread josef.pktd
On Sun, Oct 12, 2014 at 11:33 AM, Warren Weckesser wrote: > > > On Sun, Oct 12, 2014 at 11:20 AM, wrote: >> >> On Sun, Oct 12, 2014 at 10:54 AM, Warren Weckesser >> wrote: >> > >> > >> > On Sun, Oct 12, 2014 at 7:57 AM, Robert Kern >> > wrote: >> >> >> >> On Sat, Oct 11, 2014 at 11:51 PM, Warre

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread Warren Weckesser
On Sun, Oct 12, 2014 at 11:20 AM, wrote: > On Sun, Oct 12, 2014 at 10:54 AM, Warren Weckesser > wrote: > > > > > > On Sun, Oct 12, 2014 at 7:57 AM, Robert Kern > wrote: > >> > >> On Sat, Oct 11, 2014 at 11:51 PM, Warren Weckesser > >> wrote: > >> > >> > A small wart in this API is the meaning

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread josef.pktd
On Sun, Oct 12, 2014 at 10:54 AM, Warren Weckesser wrote: > > > On Sun, Oct 12, 2014 at 7:57 AM, Robert Kern wrote: >> >> On Sat, Oct 11, 2014 at 11:51 PM, Warren Weckesser >> wrote: >> >> > A small wart in this API is the meaning of >> > >> > shuffle(a, independent=False, axis=None) >> > >> >

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread Warren Weckesser
On Sun, Oct 12, 2014 at 7:57 AM, Robert Kern wrote: > On Sat, Oct 11, 2014 at 11:51 PM, Warren Weckesser > wrote: > > > A small wart in this API is the meaning of > > > > shuffle(a, independent=False, axis=None) > > > > It could be argued that the correct behavior is to leave the > > array unc

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread Robert Kern
On Sat, Oct 11, 2014 at 11:51 PM, Warren Weckesser wrote: > A small wart in this API is the meaning of > > shuffle(a, independent=False, axis=None) > > It could be argued that the correct behavior is to leave the > array unchanged. (The current behavior can be interpreted as > shuffling a 1-d s

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread Eelco Hoogendoorn
yeah, a shuffle function that does not shuffle indeed seems like a major source of bugs to me. Indeed one could argue that setting axis=None should suffice to give a clear enough declaration of intent; though I wouldn't mind typing the extra bit to ensure consistent semantics. On Sun, Oct 12, 201

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread Stefan van der Walt
Hi Warren On 2014-10-12 00:51:56, Warren Weckesser wrote: > A small wart in this API is the meaning of > > shuffle(a, independent=False, axis=None) > > It could be argued that the correct behavior is to leave the > array unchanged. I like the suggested changes. Since "independent" loses its m

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread John Zwinck
On Sun, Oct 12, 2014 at 3:51 PM, Eelco Hoogendoorn wrote: > I would argue to treat the None-False condition as an error. Indeed I agree > one might argue the correcr behavior is to 'shuffle' the singleton block of > data, which does nothing; but its more likely to come up as an unintended > error

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-12 Thread Eelco Hoogendoorn
Thanks Warren, I think these are sensible additions. I would argue to treat the None-False condition as an error. Indeed I agree one might argue the correcr behavior is to 'shuffle' the singleton block of data, which does nothing; but its more likely to come up as an unintended error than as a nat

Re: [Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-11 Thread John Zwinck
On Sun, Oct 12, 2014 at 6:51 AM, Warren Weckesser wrote: > I created an issue on github for an enhancement > to numpy.random.shuffle: > https://github.com/numpy/numpy/issues/5173 I like this idea. I was a bit surprised there wasn't something like this already. > A small wart in this API is

[Numpy-discussion] Request for enhancement to numpy.random.shuffle

2014-10-11 Thread Warren Weckesser
I created an issue on github for an enhancement to numpy.random.shuffle: https://github.com/numpy/numpy/issues/5173 I'd like to get some feedback on the idea. Currently, `shuffle` shuffles the first dimension of an array in-place. For example, shuffling a 2D array shuffles the rows: In [227]