Search
 
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
Name
2+5 =