Closed aronwc closed 5 years ago
csr_matrix((3, 4), dtype=np.int8).toarray() gives
array([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], dtype=int8)
However, changing dtype to int64 does not return any dtype in the result. It simply gives
array([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]])
I wouldn't worry about the dtype matching; there may be some configuration difference. The matrix should contain ints.
Please note that you should be using one of these two constructors to build your csr matrix:
https://docs.scipy.org/doc/scipy/reference/generated/scipy.sparse.csr_matrix.html