[Numpy-discussion] Remove a random sample from array

Martin Noblia martin.noblia at openmailbox.org
Mon May 16 12:04:41 EDT 2016


I think with `np.random.choice`

http://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.random.choice.html

On 05/16/2016 11:08 AM, Florian Lindner wrote:
> Hello,
>
> I have an array of shape (n, 2) from which I want to extract a random sample
> of 20% of rows. The choosen samples should be removed the original array and
> moved to a new array of the same shape (n, 2).
>
> What is the most clever way to do with numpy?
>
> Thanks,
> Florian
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> https://mail.scipy.org/mailman/listinfo/numpy-discussion

-- 
*Martin Noblia*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20160516/5bfd0a95/attachment.html>


More information about the NumPy-Discussion mailing list