krangl / krangl / sampleFrac

sampleFrac

fun DataFrame.sampleFrac(fraction: Double, replace: Boolean = false): DataFrame

Select random rows from a table. If receiver is grouped, sampling is done per group.

Parameters

fraction - Fraction of rows to sample.

replace - Sample with or without replacement