rok commented on code in PR #14378:
URL: https://github.com/apache/arrow/pull/14378#discussion_r994964754
##########
python/pyarrow/tests/test_sparse_tensor.py:
##########
@@ -434,6 +434,21 @@ def test_sparse_coo_tensor_scipy_roundtrip(dtype_str,
arrow_type):
assert sparse_tensor.has_canonical_format
assert out_scipy_matrix.has_canonical_format
+ scipy_matrix = coo_matrix([[0, 0], [0, 0]])
Review Comment:
Well those are actually different constructors (shape seems to be ignored in
this case):
```
1.
coo_matrix((data, (i, j)), [shape=(M, N)])
to construct from three arrays:
data[:] the entries of the matrix, in any order
i[:] the row indices of the matrix entries
j[:] the column indices of the matrix entries
scipy_matrix = coo_matrix(([0], ([0], [0])))
assert scipy_matrix.nnz == 1
2.
coo_matrix(D)
with a dense matrix D
scipy_matrix = coo_matrix([[0, 0], [0, 0]])
assert scipy_matrix.nnz == 0
```
https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.coo_matrix.html
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]