logoalt Hacker News

ainchyesterday at 3:36 PM1 replyview on HN

What problems do you run into for maths with Python? For linear algebra and ML with Jax/Numpy I find it quite readable.


Replies

jondeayesterday at 9:48 PM

I think problems is too strong a word, it's just how the syntax looks. And of course it's far better than say C++. But specifically, the lack of native vectors/matrices and very few infix operators (e.g dot product, and matrix multiplication with @ is clunky). Explicit but generic broadcasting using `.` also helps.

The way that types interact with methods _feels_ like maths. I.e. you have a method made up of mathematical operators, if you swap out an input, it typically does the natural and correct thing.