Function for doing pca in scipy