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

snowflake.snowpark.DataFrameStatFunctions¶

class snowflake.snowpark.DataFrameStatFunctions(df: DataFrame)[source]¶

Bases: object

Provides computed statistical functions for DataFrames. To access an object of this class, use DataFrame.stat.

Methods

approxQuantile(col, percentile, *[, ...])

For a specified numeric column and a list of desired quantiles, returns an approximate value for the column at each of the desired quantiles.

approx_quantile(col, percentile, *[, ...])

For a specified numeric column and a list of desired quantiles, returns an approximate value for the column at each of the desired quantiles.

corr(col1, col2, *[, statement_params])

Calculates the correlation coefficient for non-null pairs in two numeric columns.

cov(col1, col2, *[, statement_params])

Calculates the sample covariance for non-null pairs in two numeric columns.

crosstab(col1, col2, *[, statement_params])

Computes a pair-wise frequency table (a contingency table) for the specified columns.

sampleBy(col, fractions)

Returns a DataFrame containing a stratified sample without replacement, based on a dict that specifies the fraction for each stratum.

sample_by(col, fractions)

Returns a DataFrame containing a stratified sample without replacement, based on a dict that specifies the fraction for each stratum.