<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Oct 12, 2014 at 7:57 AM, Robert Kern <span dir="ltr"><<a href="mailto:robert.kern@gmail.com" target="_blank">robert.kern@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sat, Oct 11, 2014 at 11:51 PM, Warren Weckesser<br>
<<a href="mailto:warren.weckesser@gmail.com">warren.weckesser@gmail.com</a>> wrote:<br>
<br>
> A small wart in this API is the meaning of<br>
><br>
>   shuffle(a, independent=False, axis=None)<br>
><br>
> It could be argued that the correct behavior is to leave the<br>
> array unchanged. (The current behavior can be interpreted as<br>
> shuffling a 1-d sequence of monolithic blobs; the axis argument<br>
> specifies which axis of the array corresponds to the<br>
> sequence index.  Then `axis=None` means the argument is<br>
> a single monolithic blob, so there is nothing to shuffle.)<br>
> Or an error could be raised.<br>
><br>
> What do you think?<br>
<br>
</span>It seems to me a perfectly good reason to have two methods instead of<br>
one. I can't imagine when I wouldn't be using a literal True or False<br>
for this, so it really should be two different methods.<br>
<br></blockquote><div><br></div><div><br>I agree, and my first inclination was to propose a different method (and I had the bikeshedding conversation with myself about the name: "disarrange", "scramble", "disorder", "randomize", "ashuffle", some other variation of the word "shuffle", ...), but I figured the first thing folks would say is "Why not just add options to shuffle?"  So, choose your battles and all that.<br><br></div><div>What do other folks think of making a separate method?<br><br> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That said, I would just make the axis=None behavior the same for both<br>
methods. axis=None does *not* mean "treat this like a single<br>
monolithic blob" in any of the axis=-having methods; it means "flatten<br>
the array and do the operation on the single flattened axis". I think<br>
the latter behavior is a reasonable interpretation of axis=None for<br>
both methods.<br></blockquote><div><br><br></div><div>Sounds good to me.<br><br></div><div>Warren<br><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Robert Kern<br>
</font></span><div class="HOEnZb"><div class="h5">_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/numpy-discussion" target="_blank">http://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</div></div></blockquote></div><br></div></div>