python:numpy
This is an old revision of the document!
Table of Contents
NumPy
Numerical Python
ndarray
Similar to pythons list object.
- All objects in an
ndarraymust have same datatype - All math operators work on each individual element in an ''ndarray'
Good functions
import numpy as np a1 = np.zeros((4,3,2)) # Create 3-dimensional array with zeros a2 = np.ones((3,4,5)) # Create 3-dimensional array with ones a3 = np.arange(1,10) # Array with values 1..9 a4 = np.arange(10) # Array with values 0..9 a5 = np.arange(1,20,5) # Each 5th value between 1 to 19; [1, 6, 11, 16]
python/numpy.1628098010.txt.gz · Last modified: 2022/09/12 00:30 (external edit)
