[Numpy-discussion] Pull Request Review: R-like sample function
Fri Sep 2 13:45:05 CDT 2011
On Fri, Sep 2, 2011 at 12:58 PM, Nathaniel Smith <email@example.com> wrote:
> On Fri, Sep 2, 2011 at 10:14 AM, Christopher Jordan-Squire
> <firstname.lastname@example.org> wrote:
>> I made the changes discussed here and pushed them to pull request.
> I think you mean https://github.com/numpy/numpy/pull/151
Yes. Sorry for the mix-up.
>> I changed the new function's name from sample to choice and added the
>> size=1 default as Robert suggested. I also reverted all the changes
>> for sample, random, and ranf and added them to the reference docs.
> I still think the default should be sampling without replacement, so
> as to reduce confusion later when we make this available as
np.random.sample could be just a call to np.random.choice(blah, blah,
replace=False, blah). I'm not opposed to python compatibility, I just
would like a function with the defaults I want.
> You should also deprecate the current 'sample' alias (I believe this
> is basically a matter of documenting that it is deprecated, and making
> sure that it fires a deprecation warning when used). But perhaps you
> want to do that in a separate pull request, I dunno.
Yes, I think I need a separate pull request after getting some
agreement that it should be changed.
> -- Nathaniel
> NumPy-Discussion mailing list
More information about the NumPy-Discussion