[SciPy-User] asanyarray behavior with sparse matrices?

Skipper Seabold jsseabold@gmail....
Fri Feb 12 18:37:54 CST 2010


Bug or wishful thinking on my part?

from scipy import sparse
import numpy as np

X = np.random.rand(50,3)
spX = sparse.csr_matrix(X) # any sparse matrix really
newX = np.asanyarray(spX)

spX is newX
spX.ndim == newX.ndim

Cheers,

Skipper


More information about the SciPy-User mailing list