polars.spearman_rank_corr#

polars.spearman_rank_corr(a: str | Expr, b: str | Expr, ddof: int = 1, propagate_nans: bool = False) Expr[source]#

Compute the spearman rank correlation between two columns.

Missing data will be excluded from the computation.

Parameters:
a

Column name or Expression.

b

Column name or Expression.

ddof

Delta degrees of freedom

propagate_nans

If True any NaN encountered will lead to NaN in the output. Defaults to False where NaN are regarded as larger than any finite number and thus lead to the highest rank.