Skip to content

Instantly share code, notes, and snippets.

@YiLi225
Last active September 12, 2020 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YiLi225/293500935315bf6873d46b4cc718055b to your computer and use it in GitHub Desktop.
Save YiLi225/293500935315bf6873d46b4cc718055b to your computer and use it in GitHub Desktop.
## Access element by indexing
new_column1 = [i[0] for i in df.Nums]
new_column2 = [i[1] for i in df.Nums]
Out[36]:
['976', '984', '246', '252', '1419', '103', '85', '85',
'244', '540', '252', '250', '248', '248', '188', '190', '120']
Out[38]:
['660', '360', '127', '345', '1373', '515', '290', '290',
'165', '690', '235', '128', '275', '285', '300', '275', '170']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment