Fork me on GitHub 0

Pandas之corrcoef

相关系数是用以反映变量之间相关关系密切程度的统计指标。

 

其中,δx,δyδx,δy表示X,Y的方差

r的值在[-1,1]之间

用法:

numpy.corrcoef(x, y=None, rowvar=True, bias=<no value>, ddof=<no value>)[source]

参数:

x : array_like
A 1-D or 2-D array containing multiple variables and observations. Each row of x represents a variable, and each column a single observation of all those variables. Also see rowvar below.

y : array_like, optional
An additional set of variables and observations. y has the same shape as x.

rowvar : bool, optional
If rowvar is True (default), then each row represents a variable, with observations in the columns. Otherwise, the relationship is transposed: each column represents a variable, while the rows contain observations.

bias : _NoValue, optional
Has no effect, do not use.

Deprecated since version 1.10.0.

ddof : _NoValue, optional
Has no effect, do not use.

Deprecated since version 1.10.0.

返回得是个矩阵

 

posted @ 2020-03-07 18:17  amazingcode  阅读(758)  评论(0编辑  收藏  举报