I\'m trying to take out samples from two dataframes wherein I need the ratio of count maintained. eg
df1.count() = 10 df2.count() = 1000 noOfSamples = 10 >
May be you want to try below code..
val splits = data.randomSplit(Array(0.7, 0.3)) val (trainingData, testData) = (splits(0), splits(1))