used built-in np.corrcoef instead of hand-rolled loops
Vectorised the partial correlation calculation
Streamlined loading code with genfromtxt
Rationalised imports, rewrote transpose() calls to .T
Vectorised matrix normalisation
Simpler looping through connections with .nonzero