I have two pandas DataFrames:
df1
key id count
100 9821 7
200 9813 10
df2
nodekey nodeid
100 9821
200 9813
If the nodekey+nodeid in df2 match key+id in df1, count in df1 has to be set to 0. So, the result of the example above should be;
key id count
100 9821 0
200 9813 0
I tried the following (matching on key and nodekey only, as a test) but receive an error:
df1['count']=np.where((df1.key == df2.nodekey),0)
ValueError: either both or neither of x and y should be given
Suggestions?