snowflake.snowpark.DataFrame.corr¶
- DataFrame.corr(col1: ColumnOrName, col2: ColumnOrName, *, statement_params: Dict[str, str] | None = None) float | None[source] (https://github.com/snowflakedb/snowpark-python/blob/release-v1.3.0/src/snowflake/snowpark/dataframe_stat_functions.py#L107-L135)¶
Calculates the correlation coefficient for non-null pairs in two numeric columns.
Example:
- Parameters:
col1 – The name of the first numeric column to use.
col2 – The name of the second numeric column to use.
statement_params – Dictionary of statement level parameters to be set while executing this action.
- Returns:
The correlation of the two numeric columns. If there is not enough data to generate the correlation, the method returns
None. statement_params: Dictionary of statement level parameters to be set while executing this action.