Re:NumPy Illustrated: The Visual Guide to NumPy
by axi1 on Thursday December 31, 2020 @01:54AM
(#25590263)
I've finally fixed the article, thanks. Yes, broadcasting is a cool thing, but the docs mostly explains 'how' but not 'why' or 'what for'.
[ Parent
| on HN ]
Re:NumPy Illustrated: The Visual Guide to NumPy
by Schiphol on Thursday December 31, 2020 @05:36AM
(#25591472)
I'm glad I could be of help!
> Yes, broadcasting is a cool thing, but the docs mostly explains 'how' but not 'why' or 'what for'.
I'd say that, even for the 'how', thinking "OK, I have a [1, 1, 2, 2, 1] and a [3, 2, 1, 2, 5] arrays, which means that element-wise multiplication would result in a [3, 2, 2, 2, 5] array" is very useful in reasoning about broadcasting.
Just relying on simple examples and trying to build an intuition for the general case (which is the route favored in the numpy docs, I'd say) doesn't quite work, at least for me.