[Numpy-discussion] deprecate numpy.matrix

Pauli Virtanen pav at iki.fi
Mon Feb 10 17:33:40 EST 2014

11.02.2014 00:17, Matthew Brett kirjoitti:
> That is a very convincing argument.
> What would be the problems (apart from code compatibility) in making
> scipy.sparse use the ndarray semantics?

I'd estimate the effort it would take to convert scipy.sparse to ndarray
semantics is about a couple of afternoon hacks (normal, not
Ipython-size), so it should be doable.

Also, a shorthand for right-multiplication is probably necessary, as


is unwieldy.

As far as backward compatibility goes: change from * to .dot would break
everyone's code. I suspect the rest of the changes have smaller impacts.

The code breakage is such that I don't think it can be easily done by
changing the behavior of "csr_matrix". I've previously proposed adding
csr_array et al., and deprecating csr_matrix et al.. Not sure if the
*_matrix can ever be removed, but it would be useful to point new users
to use the interface with the ndarray convention.

Pauli Virtanen

More information about the NumPy-Discussion mailing list