DataFrame.
randomSplit
Randomly splits this DataFrame with the provided weights.
DataFrame
weights – list of doubles as weights with which to split the DataFrame. Weights will be normalized if they don’t sum up to 1.0.
seed – The seed for sampling.
>>> splits = df4.randomSplit([1.0, 2.0], 24) >>> splits[0].count() 2
>>> splits[1].count() 2
New in version 1.4.