[SciPy-user] sparse behaviour?

koara at atlas.cz koara at atlas.cz
Mon Oct 9 04:39:24 CDT 2006


Hello all,

i decided to represent some of my large matrices as sparse matrices. My initial assumption was that the exposed operations and interfaces are the same (only the inner representation changes), so that my code would require no changes. However my code broke down immediately; is this how things are and my assumtpion was incorrect, or is something wrong?

an example (getting covariance matrix) of code that didn't make it:

n1 = matrix([[0,0,1,0],[0,0,0,2]])
s1 = sparse.lil_matrix(n1)
cov(n1) # OK
cov(s1) # shape mismatch exception---------------------------------------
Nové spoty P. Čtvrnička najdete na www.neuservis.cz. Pravě dnes!




More information about the SciPy-user mailing list