I've googled it but couldn't find the right solution for my case.
I made a function1 before the code below to get a result in a form of list.
So basically, a[i] and a[i+1] are the list of numbers and strings.
When I used for loop as below, it works just fine until it reaches 100.
After that, it keeps showing the "The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all()."
I've changed the list to other forms to fix the problem, but it wouldn't work.
I would really appreciate it if anyone could help me with it.
range_end=200
a=dict()
for i in range(0,range_end):
if i == range_end:
break
else:
a[i]=funcion1()
a[i+1]=function1()
if a[i][3]==a[i+1][3]:
answer=a[i]
elif a[i][3] < a[i+1][3]:
answer=a[i]
else:
answer=a[i+1]
question from:
https://stackoverflow.com/questions/65894257/cant-find-the-right-answer-for-the-truth-value-of-a-series-is-ambiguous-use-a 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…