Share via


DataFrame.Sample(Double, Boolean, Nullable<Int64>) Method

Definition

Returns a new DataFrame by sampling a fraction of rows (without replacement), using a user-supplied seed.

public Microsoft.Spark.Sql.DataFrame Sample (double fraction, bool withReplacement = false, long? seed = default);
member this.Sample : double * bool * Nullable<int64> -> Microsoft.Spark.Sql.DataFrame
Public Function Sample (fraction As Double, Optional withReplacement As Boolean = false, Optional seed As Nullable(Of Long) = Nothing) As DataFrame

Parameters

fraction
Double

Fraction of rows

withReplacement
Boolean

Sample with replacement or not

seed
Nullable<Int64>

Optional random seed

Returns

DataFrame object

Applies to