import scipy.sparse
mat1 = scipy.sparse.rand(150000.0, 300000.0, density=1000000.0 / 150000.0 /
    300000.0)
mat2 = scipy.sparse.rand(300000.0, 300000.0, density=20000000.0 / 150000.0 /
    300000.0)
cmat1 = scipy.sparse.csc_matrix(mat1)
Multiplying large sparse matrices in python