[Numpy-discussion] Remove a random sample from array

Florian Lindner mailinglists at xgm.de
Mon May 16 11:45:04 EDT 2016


Am Montag, 16. Mai 2016, 10:01:38 CEST schrieb Elliot Hallmark:
> What do you mean remove them from the array? Replace with zero or NaN?

Removed like when 10 samples are taken from a (100, 2) array it becomes a (90, 
2) array. Copying the array is no problem, it removing inplace is not 
possible.

Best,
Florian
 
> On May 16, 2016 9:08 AM, "Florian Lindner" <mailinglists at xgm.de> 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



More information about the NumPy-Discussion mailing list