PYTHON
NumPy rot90 Example Rotating Once
# welcome to softhunt.net
# Python Program illustrating
# numpy.rot90() method
import numpy as np
array = np.arange(9).reshape(3, 3)
print("Original array :
", array)
# Rotating once
print("
Array being rotated 1 times :
", np.rot90(array))
NumPy rot90 Example Rotating Twice
# welcome to softhunt.net
# Python Program illustrating
# numpy.rot90() method
import numpy as np
array = np.arange(9).reshape(3, 3)
print("Original array :
", array)
# # Rotating twice
print("
Array being rotated 2 times :
", np.rot90(array, 2))
NumPy rot90 Example Rotating Three times
# welcome to softhunt.net
# Python Program illustrating
# numpy.rot90() method
import numpy as np
array = np.arange(9).reshape(3, 3)
print("Original array :
", array)
# # Rotating three times
print("
Array being rotated 3 times :
", np.rot90(array, 3))
NumPy rot90 Example Rotating four times
# welcome to softhunt.net
# Python Program illustrating
# numpy.rot90() method
import numpy as np
array = np.arange(9).reshape(3, 3)
print("Original array :
", array)
# # Rotating array 4 times : Returns same original array
print("
Array being rotated 4 times :
", np.rot90(array, 4))
NumPy rot90 Example Rotating Once
# welcome to softhunt.net
# Python Program illustrating
# numpy.rot90() method
import numpy as np
array = np.arange(9).reshape(3, 3)
print("Original array :
", array)
# Rotating once
print("
Array being rotated 1 times :
", np.rot90(array))
NumPy rot90 Example Rotating Twice
# welcome to softhunt.net
# Python Program illustrating
# numpy.rot90() method
import numpy as np
array = np.arange(9).reshape(3, 3)
print("Original array :
", array)
# # Rotating twice
print("
Array being rotated 2 times :
", np.rot90(array, 2))
NumPy rot90 Example Rotating Three times
# welcome to softhunt.net
# Python Program illustrating
# numpy.rot90() method
import numpy as np
array = np.arange(9).reshape(3, 3)
print("Original array :
", array)
# # Rotating three times
print("
Array being rotated 3 times :
", np.rot90(array, 3))
NumPy rot90 Example Rotating four times
# welcome to softhunt.net
# Python Program illustrating
# numpy.rot90() method
import numpy as np
array = np.arange(9).reshape(3, 3)
print("Original array :
", array)
# # Rotating array 4 times : Returns same original array
print("
Array being rotated 4 times :
", np.rot90(array, 4))