Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
A minimal NumPy example demonstrating array creation, arithmetic, and basic statistics.
import numpy as np
# Create arrays
arr1 = np.array([1, 2, 3, 4])
arr2 = np.array([5, 6, 7, 8])
# Array arithmetic
sum_arr = arr1 + arr2
print('Sum:', sum_arr)
# Statistical operations
print('Mean of arr1:', np.mean(arr1))
print('Standard deviation of arr2:', np.std(arr2))
# Multi-dimensional arrays
matrix = np.array([[1,2],[3,4]])
print('Matrix:
', matrix)
print('Transpose:
', matrix.T)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.