Let's say I have two dataframes of the same size, one with values:
d1 = {'values1': [1, 1,2,2], 'values2': [10, 50,200,100]}
df1 = pd.DataFrame(data=d1)
And a dataframe of booleans:
d2 = {'boolean1': [True, False,True,True], 'boolean2': [False, False,False,True]}
df2 = pd.DataFrame(data=d2)
How can I repplace values in df1 to zeros where booleans are True?
The result I am looking for is:
r = {'values1': [0, 1,0,0], 'values2': [10, 50,200,0]}
result = pd.DataFrame(data=r)
df1[df2.to_numpy()] = 0