You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ufuncs behave strangely when fed Scipy sparse matrices:
import numpy as np
import scipy.sparse as sp
A = sp.csc_matrix(np.identity(5))
B = np.asmatrix(np.ones((5,5)))
print np.multiply(A,A)
# <5x5 sparse matrix of type '<class 'numpy.float64'>'
# with 5 stored elements in Compressed Sparse Column format>
print np.multiply(B,A)
# NotImplemented
print np.multiply(A,B).dtype
# object
There are a couple things amiss here, the reason for which probably resides in Numpy:
Original ticket http://projects.scipy.org/numpy/ticket/2058 on 2012-02-17 by @pv, assigned to unknown.
The ufuncs behave strangely when fed Scipy sparse matrices:
There are a couple things amiss here, the reason for which probably resides in Numpy:
csc_matrix.multiply
is not called.See also: http://projects.scipy.org/scipy/ticket/1598
The text was updated successfully, but these errors were encountered: