NumPy is the fundamental Python package for scientific computing. However, being efficient with NumPy might require slightly changing how you write Python code.
I’m going to show you the basic idioms essential for fast numerical computations in Python with NumPy. We’ll see why Python loops are slow and why vectorizing these operations with NumPy can often be good.