How do I add 10 to any value in column col2 if it's value is 0. The general case for a larger data frame.
col1 col2
row1 1 2
row2 3 0
So I get:
col1 col2
row1 1 2
row2 3 10
This gets me the correct row:
df2.loc[lambda df2: df2['col2'] == 0 ]
This does the entire row, which I don't want:
df2.loc[df2['col2'] == 0 ] = 10