NumPy (Numerical Python) is a fundamental library for scientific computing in Python. It provides support for large, multi-dimensional arrays and matrices, along with a collection of mathematical functions to operate on these arrays efficiently.
Installation:
pip install numpy
Key Features:
- Fast and efficient N-dimensional array object (ndarray)
- Mathematical and logical operations on arrays
- Built-in linear algebra, Fourier transform, and random number generation
- Seamless integration with C/C++ and Fortran code
Code Example:
import numpy as np
# Create array
arr = np.array([1, 2, 3, 4, 5])
print("Array:", arr)
print("Mean:", np.mean(arr))
print("Sum:", np.sum(arr))