[SciPy-user] __eq__ for scipy.sparse not working?
Mon Apr 14 18:57:29 CDT 2008
On Mon, Apr 14, 2008 at 4:45 PM, Joseph Turian <email@example.com> wrote:
> I am having trouble determining equality of sparse matrices.
> Consider this code snippet. Although the sparse matrices appear to be equal,
> z==y returns false (until I convert the matrices to dense matrices).
> What is the problem with the equality test here?
Sparse matrices don't currently support that functionality. A
workaround could be abs(A-B).nnz == 0
Nathan Bell firstname.lastname@example.org
More information about the SciPy-user