[SciPy-user] __eq__ for scipy.sparse not working?

Nathan Bell wnbell@gmail....
Tue Apr 15 14:12:49 CDT 2008

On Tue, Apr 15, 2008 at 2:09 PM, Nathan Bell <wnbell@gmail.com> wrote:
> On Tue, Apr 15, 2008 at 12:37 PM, Joseph Turian <turian@gmail.com> wrote:
>  > Is there a reason that sparse matrices don't support this functionality?
>  > What is actually happening when I try equality testing for A == B?
>  > It seems undesirable that equality comparison is permitted, even though it
>  > has unexpected behavior.
>  I agree that __eq__ should either work or raise an exception.  As to
>  why __eq__ isn't supported, I haven't written the necessary code to
>  handle arrays with dtype='bool'.

I should also add that some operations cannot be supported in a
straightforward manner.  For instance, (A < 2.0) is not a safe
operation on large sparse matrices.  It's unclear what should be done
in this case.

Nathan Bell wnbell@gmail.com

More information about the SciPy-user mailing list