I am trying to find whenever 2 columns contain the number 2 at the same time, and add it to a count.
I tried following the recommendations of this post Truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all() in my code:
count = 0
if (df['Bedroom2'] == 2).bool() & (df['Car'] == 2).bool():
count += 1
print(count)
However, it still displays the error:
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().