I want to split a data-frame in row-wise order. If there are 100
rows, then desired split into 4 equal data-frames should have indices 0-24
, 25-49
, 50-74
, and 75-99
, respectively.
The only pre-defined function available is randomSplit
. But randomSplit
randomizes the data before splitting.
Another way I think of is to find the count of data using count
reduction operation and then keep extracting the data using take
but it is very expensive.
Is there any other way to achieve the above while maintaining the same order?