hmmm, I thought the matrix class was deprecated? At least it says so in the official numpy documentation:
https://numpy.org/doc/stable/reference/generated/numpy.matri...
Anyhow, the * operator does not work with sparse matrices, and you really don't want to maintain two versions of your formulas. Thus, you are unfortunately stuck with @ or .dot
I guess there might be a much more math-friendly library than numpy, but I have never found it.
Re:A new release for GNU Octave
by Denvercoder9 on Wednesday December 16, 2020 @11:36AM
(#25444578)
> hmmm, I thought the matrix class was deprecated? At least it says so in the official numpy documentation:
Huh, you're right. Bummer, I hadn't noticed that yet. I agree that an ergonomic matrix class is sorely missing in the Python ecosystem. It shouldn't even be that hard to implement, since all the plumbing is already there.
If you use the numpy.matrix type instead of numpy.array, the * operator becomes matrix multiplicaton.