Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas create column if equals

df['color'] = ['red' if x == 'Z' else 'green' for x in df['Set']]
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #pandas #create #column #equals
ADD COMMENT
Topic
Name
4+4 =