[Numpy-discussion] deprecate numpy.matrix
alex
argriffi at ncsu.edu
Tue Feb 11 13:11:05 EST 2014
On Tue, Feb 11, 2014 at 12:14 PM, Chris Barker <chris.barker at noaa.gov> wrote:
> On Tue, Feb 11, 2014 at 8:25 AM, Matthew Brett <matthew.brett at gmail.com>
> wrote:
>>
>> > Anyway, I would say that there is a clear use for the matrix class:
>> > readability of linear algebra code and hence a lower chance of errors, so
>> > higher productivity.
>>
>> Yes, but it looks like there are not any developers on this list who
>> write substantial code with the np.matrix class, so, if there is a
>> gain in productivity, it is short-lived, soon to be replaced by a
>> cost.
>
>
> to re-iterate:
>
> matrix is NOT for newbies, nor is it for higher productivity or fewer errors
> in production code -- the truth is, the ratio of linear algebra expressions
> like the above to element-wise, etc. operations that ndarray is well suited
> to is tiny in "real" code. Did anyone that used MATLAB for significant
> problems get not get really really annoyed by all the typing of ".*" ?
>
> What matrix is good for is what someone here described as "domain specific
> language" -- i.e. that little bit of code that really is doing mostly linear
> algebra.
This point would suggest that the "domain specific language" defined
by the numpy.matrix semantics would be particularly useful for
representations of linear operators for which elementwise modification
might be less efficient (for example as in some implementations of
sparse matrices) or essentially unavailable (for example as in
matrix-free linear operators).
Alex
More information about the NumPy-Discussion
mailing list