systemml-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arijit chakraborty <>
Subject Randomly Selecting rows from a dataframe
Date Fri, 21 Apr 2017 20:42:50 GMT

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!


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message