PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import numpy as np
# create 5 2x2 matrices
matrices = np.array([
[[1, 1],
[1, 1]],
[[2, 2],
[2, 2]],
[[3, 3],
[3, 3]],
[[4, 4],
[4, 4]],
[[5, 5],
[5, 5]],
])
# dump them out
print(matrices)
# change the third inner matrix [2], first row [0], second column [1]
matrices[2][0][1] = 9
# dump them out again
print(matrices)
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run