Created
March 6, 2019 13:26
-
-
Save HoweChen/4a45172379fe170bcf24d9073d7c0fc9 to your computer and use it in GitHub Desktop.
[Python extract column to a new list]Python extract Column to a new list #Python
This file contains 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
#从一个列表中提取每一行的列作为新的列表 | |
a=["cba","daf","ghi"] | |
a=list(zip(*a)) | |
print(a) # [('c', 'd', 'g'), ('b', 'a', 'h'), ('a', 'f', 'i')] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment