Created
August 12, 2013 15:17
-
-
Save cizixs/6211754 to your computer and use it in GitHub Desktop.
reverse a two-dimension array in python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| arr = [[1,2,3],[4,5,6],[7,8,9],[10,11,12]] | |
| print [[r[col] for r in arr] for col in rage(len(arr[0]))] | |
| #another simple but confuding way | |
| print map(list, zip(*arr)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment