snowflake.snowpark.DataFrame.sample¶

DataFrame.sample(frac: Optional[float] = None, n: Optional[int] = None) → DataFrame[source]¶

Samples rows based on either the number of rows to be returned or a percentage of rows to be returned.

Parameters:
  • frac – the percentage of rows to be sampled.

  • n – the number of rows to sample in the range of 0 to 1,000,000 (inclusive).

Returns:

a DataFrame containing the sample of rows.