bug for log1p on csr_matrix #8228
Labels
defect
A clear bug or issue that prevents SciPy from being installed or used as expected
scipy.sparse.linalg
Milestone
I'm trying to use log1p function on csr_matrix. I use two different ways to construct the same csr_matrix but got different results after applying log1p.
Create the matrix by directly using a python list:
Create the matrix by using indices:
Apparently in the second case there are two separate 1s and two separate 0s added to the same entry in the final csr_matrix, and the corresponding entry in the log1p result is log(1+1) * 2 = 1.39, where it should be log(1 + 2*1) = 1.099.
The text was updated successfully, but these errors were encountered: