DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
SCRIPT & CODE EXAMPLE
CODE EXAMPLE FOR PYTHON
Getting the first element from each list in a column of lists
# df['new_column'] = df['codes'].str.get(0) df['new_column'] = df['codes'].str[0]
Source by stackoverflow.com #
PREVIOUS
NEXT
Tagged:
#Getting
#element
#list
#column
#lists
ADD COMMENT
Topic
COMMENT
Name
2+5 =
Submit