1import pandas as pd
2pd.options.mode.chained_assignment = None # default='warn'
3
1>>> df = pd.DataFrame(data=data, index=index)
2
3>>> df.loc[mask, "z"] = 0
4>>> df
5 x y z
6a 1 1 0
7b 2 3 98
8c 4 9 0
9d 8 27 0
10e 16 81 64
11