On Wed, Feb 17, 2016 at 7:17 PM, Juan Nunez-Iglesias <jni.s...@gmail.com>
wrote:

> Ah! Touché! =) My last and admittedly weak defense is that I've been
> writing numpy since before 1.7. =)
>
> On Thu, Feb 18, 2016 at 11:08 AM, Alan Isaac <alan.is...@gmail.com> wrote:
>
>> On 2/17/2016 7:01 PM, Juan Nunez-Iglesias wrote:
>>
>>> Notice the limitation "1D array-like".
>>>
>>
>>
>>
>> http://docs.scipy.org/doc/numpy-1.10.0/reference/generated/numpy.random.choice.html
>> "If an int, the random sample is generated as if a was np.arange(n)"
>>
>
(un)related aside:
my R doc quote about "may lead to undesired behavior" refers to this,
IIRC, R's `sample` was the inspiration for this function

but numpy distinguishes scalar from one element (1D) arrays

>>> for i in range(3, 10): np.random.choice(np.arange(10)[i:])

Josef



>
>> hth,
>>
>> Alan Isaac
>>
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion@scipy.org
>> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion
>
>
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
https://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to