Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

make a condition statement on column pandas

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