Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

rotate 2d array

#clockwise:
rotated = list(zip(*original[::-1]))
#counterclockwise:
rotated_ccw = list(zip(*original))[::-1]
Comment

rotate 2d array

rotated = list(zip(*original[::-1]))
Comment

PREVIOUS NEXT
Code Example
Python :: python select from list by condition 
Python :: pyqt tutorial 
Python :: why a Python Arithmetic Operators used 
Python :: convert str to datetime 
Python :: dict comprehension 
Python :: print(int()) 
Python :: realtime output subprocess 
Python :: find all unique substring permutations of a string of a specific length python 
Python :: create new column with mask pandas 
Python :: reset index python 
Python :: numpy reshape 
Python :: length of a string python 
Python :: poppler on colab 
Python :: os.startfile() python 
Python :: flat numpy array 
Python :: pandas filter on two columns 
Python :: python sort a 2d array by custom function 
Python :: python excel file 
Python :: np.arrange 
Python :: python random generator from list 
Python :: move column in pandas dataframe 
Python :: python write into file at position 
Python :: unsplash python 
Python :: pandas df exact equals 
Python :: List comprehension if-else 
Python :: find array length in python 
Python :: binary tree in python 
Python :: pandas dataframe drop rows with -ve in column value 
Python :: django update field after save 
Python :: histogram chart plotly 
ADD CONTENT
Topic
Content
Source link
Name
5+6 =