[SciPy-Dev] Sparse boolean specification
Sun Apr 21 21:00:48 CDT 2013
Hello, I've been thinking about how I would write the bool handling. I
wanted to bounce some ideas off the list, to see what y'all thought.
When comparing two sparse matrices of the same type. A sparse matrix of the
same type, with bool dtype, should be returned with all True elements with
original sets of elements. A element without a corresponding value in the
other spmatrix is False. Does this make sense? An example:
>>> coo_matrix([True, True], [1,1], [2,2]) == coo_matrix([True, True],
coo_matrix([True], , )
When comparing sparse matrices with numpy ndarrays or matrices. The
sparsematrix can probably be easily expressed as a dense matrix. So we
should spmatrix.toarray() or spmatrix.todense() and compare it with the
ndarray or matrix. Returning a ndarray or matrix with bool dtype where each
element is a[i,j] = (b[i,j] == c[i,j]), for comparing B == C. Like wise for
Does this sound good so far?
Also, should I write this up like a PEP?
Blake G. -- http://cwl.cx
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the SciPy-Dev