def pearson_r(data_1, data_2):
"""
Compute the Pearson correlation coefficient between two samples.
Parameters
----------
data_1 : array_like
One-dimensional array of data.
data_2 : array_like
One-dimensional array of data.
Returns
-------
output : float
The Pearson correlation coefficient between `data_1`
and `data_2`.
Notes
-----
.. Only entries where both `data_1` and `data_2` are not NaN are
used.
.. If the variance of `data_1` or `data_2` is zero, return NaN.
"""
x, y = _convert_two_data(data_1, data_2, inf_ok=False, min_len=2)
return _pearson_r(x, y)
# @numba.jit(nopython=True)
评论列表
文章目录