NumPy is short for "Numerical Python". It is widely used in field of science and engineering. The NumPy library contains multidimensional array data structures, such as the homogeneous, N-dimensional ndarray, and a large library of functions that operate efficiently on these data structures.
Advantages of Numpy:
- NumPy uses fixed-type arrays (ndarray) that are much more memory- and compute-efficient than Python lists.
- Operations are vectorized (done in C under the hood), which makes NumPy much faster than loops in Python.
- Supports n-dimensional arrays (ndarrays), unlike native Python which mainly supports lists. Great for working with matrices, tensors, images, etc.
- Broadcasting: Allows arithmetic operations on arrays of different shapes without writing loops or reshaping manually.
- Provides a very rich Set of Mathematical Functions
- Powerful Indexing and Slicing abilities.
- NumPy arrays are stored at one continuous place in memory unlike lists, so processes can access and manipulate them very efficiently.