Skip to content

correlation builtin

correlation(
    data, *, columns=None, weights=None, method="pearson"
)

Correlation matrix of the columns of data, each pair over rows without NaN.

Parameters:

Name Type Description Default
data (array_like, PointSet, BlockModel, Table or dict)

(n, d) values, or named columns.

required
columns sequence of str

Columns of data to correlate, in order; default all of them.

None
weights array_like or str

Declustering weights, or their column in data.

None
method (pearson, spearman, covariance)

Pearson correlation, rank correlation, or the covariance (over the sum of weights, as the variance of describe), variances on the diagonal.

"pearson"

Returns:

Type Description
ndarray

(d, d) symmetric matrix.

used in