Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

add a column while iterating rows pandas

mask = (df['Qty'] == 1) & (df['Price'] == 10)
df.loc[mask, 'Buy'] = 1
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #add #column #iterating #rows #pandas
ADD COMMENT
Topic
Name
4+1 =