Create a gist now

Instantly share code, notes, and snippets.

anonymous /gist:578226
Created Sep 13, 2010

What would you like to do?
import scipy.sparse
import os
import gc
import time
import numpy
matrix ="cat sparse_matrix.head try3"))
mat2 = matrix.tocsc()
numpy.savez('foo.npz', mat=mat2)
norms = numpy.zeros((1,mat2.shape[1]))
import math
for j in range(0, mat2.shape[1] - 1):
if (j % 10000 == 0):
print('j is', j)
c = mat2.getcol(j)
norms[0, j] = scipy.linalg.norm(c.A)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment