Skip to content

Instantly share code, notes, and snippets.

@HoweChen
Created March 6, 2019 13:26
Show Gist options
  • Save HoweChen/4a45172379fe170bcf24d9073d7c0fc9 to your computer and use it in GitHub Desktop.
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
#从一个列表中提取每一行的列作为新的列表
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