Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas assign value to row based on condition

df.loc[df['stream'] == 2, ['feat','another_feat']] = 'a', 'b'
 
PREVIOUS NEXT
Tagged: #pandas #assign #row #based #condition
ADD COMMENT
Topic
Name
6+7 =