如果你尝试某个操作并且看到如下异常:
>>> if pd.Series([False, True, False]): print("I was true")Traceback ...ValueError: The truth value of an array is ambiguous. Use a.empty, a.any() or a.all().
>>> if pd.Series([False, True, False]):
print("I was true")
Traceback
...
ValueError: The truth value of an array is ambiguous. Use a.empty, a.any() or a.all().
解释及处理方式请见比较。
同时请见陷阱。