Python Reading
Browse
Numerical & Scientific Computing with Python
Key Ideas
Creating np arrays
Slicing and reshaping arrays
Operations on arrays
In-Class Activity
Work through
numpy-tutorial2.py
Active Learning
Create a vector Z with values ranging from 10 to 49
Reverse Z
Create a 3x3 matrix M with values ranging from 0 to 8
Create a 3x3x3 array R with random values
Create a 3x3 identity matrix
Can you figure out what the following code produces without running it first?
Z = np.zeros((5,5)) Z += np.arange(5) print(Z)