Created
          March 20, 2020 09:55 
        
      - 
      
- 
        Save ostwalprasad/f4f3de7d9bdae087b3b5cefb74110e23 to your computer and use it in GitHub Desktop. 
Revisions
- 
        ostwalprasad created this gist Mar 20, 2020 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ import numpy as np import pandas as pd df = YOUR_DATAFRAME ones = np.ones([df_shape[0],df_shape[0]]) dev_mat = df - (ones @ df)/df_shape[0] cov_mat = (dev_mat.T @ dev_mat) / df_shape[0]