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

nnz not correct for scalars. #47

Closed
hameerabbasi opened this Issue Dec 27, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@hameerabbasi
Collaborator

hameerabbasi commented Dec 27, 2017

The x.nnz should be 1 for for a nonzero scalar x, yet it is zero. MWE:

import numpy as np
x = 1 + np.random.rand(5, 5)
import sparse
xs = sparse.COO.from_numpy(x)
xs[1, 1]
Out[6]: <COO: shape=(), dtype=float64, nnz=0, sorted=True, duplicates=False>
@hameerabbasi

This comment has been minimized.

Collaborator

hameerabbasi commented Dec 27, 2017

Fixed with #48.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment