3 ms·
> use a bizarre notation (either @ or .dot look very ugly in formulas). If you use the numpy.matrix type instead of numpy.array, the * operator becomes matrix
by Denvercoder9 6y ago
> use a bizarre notation (either @ or .dot look very ugly in formulas).
If you use the numpy.matrix type instead of numpy.array, the * operator becomes matrix multiplicaton.
- enriquto 6y agohmmm, 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.matrix.html 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.
- Denvercoder9 6y ago> 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.
- deleted 6y ago[deleted]