3 ms·
They are actually from numpy, scipy just re-exports them, so they work with numpy arrays which the built in maths would not. I guess the author writes a lot of
by snops 8y ago
They are actually from numpy, scipy just re-exports them, so they work with numpy arrays which the built in maths would not. I guess the author writes a lot of scientific code, so is in the habit of using them.
Numpy arrays are much faster than python lists etc for maths and matrix operations, (e.g. multiply this 1000 element vector by 2), which are common in scientific and engineering code.
https://docs.scipy.org/doc/numpy-1.15.1/reference/generated/numpy.sin.html https://docs.scipy.org/doc/numpy-1.15.1/reference/generated/...
- johndcook 8y agoYes, the author does write a lot of scientific code and is in the habit of using SciPy. -- the author :)