1>>> m = np.array([[1,2],[3,4]], int)
2>>> m
3array([[1, 2],
4 [3, 4]])
5>>> np.rot90(m)
6array([[2, 4],
7 [1, 3]])
8>>> np.rot90(m, 2)
9array([[4, 3],
10 [2, 1]])
11>>> m = np.arange(8).reshape((2,2,2))
12>>> np.rot90(m, 1, (1,2))
13array([[[1, 3],
14 [0, 2]],
15 [[5, 7],
16 [4, 6]]])
17
1In [x]: theta = np.radians(30)
2In [x]: c, s = np.cos(theta), np.sin(theta)
3In [x]: R = np.array(((c, -s), (s, c)))
4Out[x]: print(R)
5[[ 0.8660254 -0.5 ]
6 [ 0.5 0.8660254]]
7