
On Mon, Dec 27, 2021 at 4:07 PM Steven D'Aprano
Julia (if I recall correctly) has a nice syntax for automatically turning any function or method into an element-wise function:
And numpy has an even easier one: np.log(a_scalar) np.log(an_array) I’m only being a little bit silly. In fact, array-oriented operations are really nifty, a heck of a lot easier to parse than map, or comprehensions, etc. Filtering can be a bit ugly, but not too bad. MATLAB has a duplicate set of operators: the matrix ones and element wise ones. We struggled for years how to do that in Python — until someone realized that matrix multiplication is the only actually useful matrix operation. Hence @ and now we’re good. -CHB -- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython