a=np.arange(1,10)
b=pd.Series(a)
print(a==b)
output: 0. True
- True
- True ...
- True
but when I made it in a loop
if (a==b):
print('True')
output: ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().