snowflake.snowpark.DataFrame.sample

DataFrame.sample(frac: Optional[float] = None, n: Optional[int] = None) DataFrame[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/dataframe.py#L3500-L3524)

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.

语言: 中文