Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

rotate 2d array

#clockwise:
rotated = list(zip(*original[::-1]))
#counterclockwise:
rotated_ccw = list(zip(*original))[::-1]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #rotate #array
ADD COMMENT
Topic
Name
9+9 =