datatable.cov()¶
Calculate covariance
between col1
and col2
.
Parameters¶
col1
,
col2
FExpr
Input columns.
Examples¶
from datatable import dt, f
DT = dt.Frame(A = [0, 1, 2, 3], B = [0, 2, 4, 6])
DT
A | B | ||
---|---|---|---|
int32 | int32 | ||
0 | 0 | 0 | |
1 | 1 | 2 | |
2 | 2 | 4 | |
3 | 3 | 6 |
DT[:, dt.cov(f.A, f.B)]
C0 | ||
---|---|---|
float64 | ||
0 | 3.33333 |
See Also¶
corr()
– function to calculate correlation between two columns.
The content on this page is licensed under the Creative Commons Attribution 4.0 License
(CC BY 4.0) ,
and code samples are licensed under the MIT License.