8000 Strange behavior of binary ufunc with scipy sparse matrices (Trac #2058) · Issue #2650 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

Strange behavior of binary ufunc with scipy sparse matrices (Trac #2058) #2650

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
numpy-gitbot opened this issue Oct 19, 2012 · 2 comments
Closed

Comments

@numpy-gitbot
Copy link

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:

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:

See also: http://projects.scipy.org/scipy/ticket/1598

@ron819
Copy link
ron819 commented Nov 13, 2018

Is this still an issue?

@mattip
Copy link
Member
mattip commented Nov 13, 2018

Whatever the original issue was, the calls to multiply now succeed. I am closing, please open a new issue if needed.

@mattip mattip closed this as completed Nov 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants
0