Skip to content
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
Closed

nnz not correct for scalars. #47

hameerabbasi opened this issue Dec 27, 2017 · 1 comment
Labels

Comments

@hameerabbasi
Copy link
Collaborator

@hameerabbasi 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
Copy link
Collaborator Author

@hameerabbasi 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant