News for hackers. Stuff that matters.
Re:NumPy 2.0.0 by o11c on Monday June 17, 2024 @12:10AM (#40702238)
Explicit internal broadcasting (by adding an axis with an explicit `indefinite` size instead of `1`) would be so much simpler to reason about.

Unfortunately there is far too much existing code and python is not type-safe.

Re:NumPy 2.0.0 by bramblerose on Monday June 17, 2024 @02:58AM (#40702955)
You can do this with `np.newaxis` - in the NumPy course I wrote as TA we required students to always be explicit about the axes (also in e.g. sums). It would be nice if you could disable the implicit broadcasting, but as you mention that would break so much code
Re:NumPy 2.0.0 by o11c on Monday June 17, 2024 @10:46AM (#40706125)
`np.newaxis` explicitly adds a `1` dimension, not an `indefinite` one.