Hacker News new | past | comments | ask | show | jobs | submit login

Python's way of treating * as element-wise multiplication when operands are arrays makes it easier to vectorize algorithms - if f(a, b) = a * b, then you can treat a and b as numbers, a number and an array, or as two (multi-dimensional) arrays. In Matlab, you'd have to use *. for that.



FYI, in MATLAB you'd only need to use .* in the last of your three cases.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: