print(a)
block3 = a[3:6, 0:3]
block3[:] = np.rot90(block3.copy())
print(a)
a = np.arange(36).reshape(6, 6)
block3 = a[3:6, 0:3]
block3[:] = np.rot90(block3.copy(), -1)
print(a)
transpose/rotate a block of a matrix in python