Python scientific ecosystem#
There are a lot of very good Python packages for sciences. The fundamental packages are in particular:
Numpy: numerical computing with powerful numerical arrays objects, and routines to manipulate them.
Scipy: high-level numerical routines. Optimization, regression, interpolation, etc.
Matplotlib: 2D-3D visualization, “publication-ready” plots.
With IPython and Spyder, Python plus these fundamental scientific packages
constitutes a very good alternative to Matlab, that is technically very similar (using
the libraries Blas and Lapack). Matlab has a Just-In-Time (JIT) compiler so that Matlab
code is generally faster than Python. However, we will see that Numpy is already quite
efficient for standard operations and other Python tools (for example PyPy, Cython,
Numba, Pythran, …) can be used to optimize the code to reach the performance of
optimized Matlab code.
The advantages of Python over Matlab are its open-source nature, its high polyvalency (and nicer syntax) and its huge open-source ecosystem:
sympy for symbolic computing,
pandas, statsmodels, seaborn for statistics,
mpi4py for MPI communications,
opencv, scikit-image, pyopencl for image processing,
scikit-learn, keras, tensorflow, pytorch, mxnet for machine learning,
bokeh for display data efficiently,
mayavi for 3D visualization,
…
SciPy or NumPy ?
Scipy also provides a submodule for linear algebra scipy.linalg. It provides
an extension of numpy.linalg.
For more info, see the related FAQ entry.