XArray and Sparse #6683
Unanswered
mvsantosdev
asked this question in
Q&A
Replies: 2 comments 4 replies
-
You will need to use the In [3]: sxr.data
Out[3]: <COO: shape=(100, 100, 100), dtype=float64, nnz=100175, fill_value=0.0>
In [4]: sxr.data.todense()
Out[4]:
array([[[0. , 0. , 0. , ..., 0. ,
0. , 0.95706737],
[0. , 0. , 0. , ..., 0. ,
0. , 0. ],
[0. , 0.99498561, 0. , ..., 0. ,
0. , 0. ],
...,
[0. , 0. , 0. , ..., 0. ,
0. , 0.90212799],
[0. , 0. , 0. , ..., 0. ,
0. , 0.93170908],
[0. , 0. , 0. , ..., 0. ,
0.93345325, 0. ]],
... i hope this helps... |
Beta Was this translation helpful? Give feedback.
2 replies
-
The
Suggests that it should call |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to use the xarray and sparse combined. for this simple example how I get the values of sxr?
I tried sxr.values and the follow error message raised:
RuntimeError: Cannot convert a sparse array to dense automatically. To manually densify, use the todense method.
Them I tried sxr.todense() and another error raises:
AttributeError: 'DataArray' object has no attribute 'todense'
How can I solve this?
Cheers
Beta Was this translation helpful? Give feedback.
All reactions