snowflake.snowpark.DataFrame.sample¶
- DataFrame.sample(frac: Optional[float] = None, n: Optional[int] = None) DataFrame[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.30.0/snowpark-python/src/snowflake/snowpark/dataframe.py#L5402-L5443)¶
- 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 - DataFramecontaining the sample of rows.