Skip to main content

pearsonr

pearsonr(X, Y, axis=0, keepdims=False, nan=None)

Pearson correlation coefficient.

Parameters

Name Type Description Default
X ndarray First input array. required
Y ndarray Second input array. required
axis int Axis along which to compute the correlation. 0
keepdims bool If True, the output will have the same number of dimensions as the input arrays. False
nan float or None If not None, NaNs in the input arrays will be replaced with this value. None

Returns

Name Type Description
r float or ndarray Pearson correlation coefficient.