When I run this code I get the following error:
if products.code == 'attendance':
print('Attendance Product Detected')
else:
print('Attendance Not Detected')
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
However, when I type this in the console, it works fine:
products.code == 'attendance'
Out:
0 True
Name: code, dtype: bool
How can I fix this, so the if and else functions work?