snowflake.snowpark.modin.plugin.extensions.window_overrides.Rolling.corr¶
- Rolling.corr(other: Optional[DataFrame] = None, pairwise: Optional[bool] = None, ddof: int = 1, numeric_only: bool = False, **kwargs: Any)[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.26.0/snowpark-python/src/snowflake/snowpark/modin/plugin/extensions/window_overrides.py#L334-L350)¶
Calculate the rolling correlation.
- Parameters:
other (Series or
DataFrame
, optional) – If not supplied then will default to self and produce pairwise output.pairwise (bool, default None) – If False then only matching columns between self and other will be used and the output will be a DataFrame. If True then all pairwise combinations will be calculated and the output will be a MultiIndexed
DataFrame
in the case ofDataFrame
inputs. In the case of missing elements, only complete pairwise observations will be used.ddof (int, default 1) – Delta Degrees of Freedom. The divisor used in calculations is
N - ddof
, whereN
represents the number of elements.numeric_only (bool, default False) – Include only float, int, boolean columns.
- Returns:
Return type is the same as the original object with np.float64 dtype.
- Return type:
Examples
>>> df1 = pd.DataFrame({"col1": [1, 4, 3]}) >>> df2 = pd.DataFrame({"col1": [1, 6, 3]}) >>> df1.rolling(window=3, min_periods=3).corr(other=df2,pairwise=None, numeric_only=True) col1 0 NaN 1 NaN 2 0.953821