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

Eelco Hoogendoorn hoogendoorn.eelco at gmail.com
Sun Oct 12 06:00:29 EDT 2014

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, 2014 at 10:56 AM, Stefan van der Walt <stefan at sun.ac.za>

> Hi Warren
> On 2014-10-12 00:51:56, Warren Weckesser <warren.weckesser at gmail.com>
> 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 meaning
> when axis is None, I would expect this to have the same effect as
> `shuffle(a, independent=True, axis=None)`.  I think a shuffle function
> that doesn't shuffle will confuse a lot of people!
> Stéfan
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20141012/ee142fea/attachment.html>

More information about the NumPy-Discussion mailing list