xxxxxxxxxx
# welcome to softhunt.net
# Python Program illustrating
# numpy.rot90() method
import numpy as np
array = np.arange(9).reshape(3, 3)
print("Original array : \n", array)
# # Rotating twice
print("\nArray being rotated 2 times : \n", np.rot90(array, 2))
xxxxxxxxxx
# welcome to softhunt.net
# Python Program illustrating
# numpy.rot90() method
import numpy as np
array = np.arange(9).reshape(3, 3)
print("Original array : \n", array)
# Rotating once
print("\nArray being rotated 1 times : \n", np.rot90(array))
xxxxxxxxxx
# welcome to softhunt.net
# Python Program illustrating
# numpy.rot90() method
import numpy as np
array = np.arange(9).reshape(3, 3)
print("Original array : \n", array)
# # Rotating three times
print("\nArray being rotated 3 times : \n", np.rot90(array, 3))
xxxxxxxxxx
# welcome to softhunt.net
# Python Program illustrating
# numpy.rot90() method
import numpy as np
array = np.arange(9).reshape(3, 3)
print("Original array : \n", array)
# # Rotating array 4 times : Returns same original array
print("\nArray being rotated 4 times : \n", np.rot90(array, 4))