<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Oct 16, 2014 at 12:40 PM, Nathaniel Smith <span dir="ltr"><<a href="mailto:njs@pobox.com" target="_blank">njs@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On Thu, Oct 16, 2014 at 4:39 PM, Warren Weckesser<br>
<<a href="mailto:warren.weckesser@gmail.com">warren.weckesser@gmail.com</a>> wrote:<br>
><br>
> On Sun, Oct 12, 2014 at 9:13 PM, Nathaniel Smith <<a href="mailto:njs@pobox.com">njs@pobox.com</a>> wrote:<br>
>><br>
</span><span class="">>> Regarding names: shuffle/permutation is a terrible naming convention<br>
>> IMHO and shouldn't be propagated further. We already have a good<br>
>> naming convention for inplace-vs-sorted: sort vs. sorted, reverse vs.<br>
>> reversed, etc.<br>
>><br>
>> So, how about:<br>
>><br>
>> scramble + scrambled shuffle individual entries within each<br>
>> row/column/..., as in Warren's suggestion.<br>
>><br>
>> shuffle + shuffled to do what shuffle, permutation do now (mnemonic:<br>
>> these break a 2d array into a bunch of 1d "cards", and then shuffle<br>
>> those cards).<br>
>><br>
>> permuted remains indefinitely, with the docstring: "Deprecated alias<br>
>> for 'shuffled'."<br>
><br>
> That sounds good to me.  (I might go with 'randomize' instead of 'scramble',<br>
> but that's a second-order decision for the API.)<br>
<br>
</span>I hesitate to use names like "randomize" because they're less<br>
informative than they feel seem -- if asked what this operation does<br>
to an array, then it would be natural to say "it randomizes the<br>
array". But if told that the random module has a function called<br>
randomize, then that's not very informative -- everything in random<br>
randomizes something somehow.<br>
<div class=""><div class="h5"><br></div></div></blockquote><div><br><br></div><div>I had some similar concerns (hence my original "disarrange"), but "randomize" seemed more likely to be found when searching or browsing the docs, and while it might be a bit too generic-sounding, it does feel like a natural verb for the process.   On the other hand, "permute" and "permuted" are even more natural and unambiguous.  Any objections to those?  (The existing function is "permutation".)<br><br>Whatever the names, the docstrings for the four functions should be cross-referenced in their "See Also" sections to help users find the appropriate function.<br><br></div><div>By the way, "permutation" has a feature not yet mentioned here: if the argument is an integer 'n', it generates a permutation of arange(n).  In this case, it acts like matlab's "randperm" function.  Unless we replicate that in the new function, we shouldn't deprecate "permutation".<br></div><div><br>Warren<br><br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">
-n<br>
<br>
--<br>
Nathaniel J. Smith<br>
Postdoctoral researcher - Informatics - University of Edinburgh<br>
<a href="http://vorpus.org" target="_blank">http://vorpus.org</a><br>
_______________________________________________<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>