Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jaems33/35d8569c672e071309f2275ad26a54b1 to your computer and use it in GitHub Desktop.
Save jaems33/35d8569c672e071309f2275ad26a54b1 to your computer and use it in GitHub Desktop.
import numpy as np
A = np.array([[90, 80, 40],
[90, 60, 80],
[60, 50, 70],
[30, 40, 70],
[30, 20, 90]])
ones = np.ones([5, 5])
deviation = A - (ones.dot(A) / len(A))
covariance = deviation.T.dot(deviation)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment