import numpy as np
A = [45,37,42,35,39]
B = [38,31,26,28,33]
C = [10,15,17,21,12]
data = np.array([A,B,C])
covMatrix = np.cov(data,bias=True)
print (covMatrix)
# Covariance provides the a measure of strength of correlation between two variable or more set of variables. The covariance matrix element Cij is the covariance of xi and xj. The element Cii is the variance of xi.
# If COV(xi, xj) = 0 then variables are uncorrelated
# If COV(xi, xj) > 0 then variables positively correlated
# If COV(xi, xj) > < 0 then variables negatively correlated
# Python code to demonstrate the use of numpy.cov
import numpy as np
x = np.array([[0, 3, 4], [1, 2, 4], [3, 4, 5]])
print("Shape of array:
", np.shape(x))
print("Covariance matrix of x:
", np.cov(x))