I have a dataframe:
df = pd.DataFrame({'c1': ["dog", "cat", "bird"], 'c2': ["rabbit", "rat", "snake"], 'c3': ["dog", "fish", "snake"]})
It looks like:
Whenever a value in c3 appears in the same row in any other column, I want to update the c3 value to be a blank. Like this:
Here's what I have tried:
df["c3"] = df.apply(lambda x: x if x.c1 or x.c2 not in x.c3 else Nan, axis = 1)
But this throws an error:
TypeError: argument of type 'numpy.int64' is not iterable

