Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Changing the shape of arrays.
import numpy as np
arr = np.arange(12)
print('Original array:', arr)
matrix = arr.reshape((3,4))
print('Reshaped 3x4 matrix:\n', matrix)
flattened = matrix.flatten()
print('Flattened array:', flattened)NumPy (Numerical Python) is an open-source Python library that provides high-performance, multi-dimensional arrays and a wide range of mathematical functions to operate on these arrays, forming the foundation of scientific computing in Python.
Origin & Creator
NumPy was created by Travis Oliphant in 2005 as an extension of the older Numeric and Numarray libraries to unify array computing in Python.
Industrial Note
NumPy is essential in virtually all scientific and engineering computing in Python and underpins libraries like SciPy, Pandas, Matplotlib, PyTorch, and TensorFlow.