human
Modifying a subset of rows in a pandas dataframe
assistant
Here is some code to set the value in column 'B' to NaN if the corresponding value in column 'A' is equal to 0 in pandas dataframe `df`

df.ix[df.A == 0, 'B'] = np.nan

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.