You are viewing documentation about an older version (1.3.0). View latest version

snowflake.snowpark.DataFrame.sample

DataFrame.sample(frac: float | None = None, n: int | None = 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.