You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@systemml.apache.org by arijit chakraborty <ak...@hotmail.com> on 2017/04/21 20:42:50 UTC
Randomly Selecting rows from a dataframe
Hi,
Suppose I've a dataframe of 10 variables (X1-X10) and have 1000 rows. Now I want to randomly select rows so that I've a subset of the dataset.
Can anyone please help me to solve this problem?
I tried the following code:
randSample = sample(nrow(dataframe), 200);
This gives me a column matrix with position of the row randomly selected. But I could not able to solve how from this matrix I can subset data from original dataframe.
Thank you!
Arijit