十三、陷阱

如果你尝试某个操作并且看到如下异常:

  1. >>> if pd.Series([False, True, False]):
  2. print("I was true")
  3. Traceback
  4. ...
  5. ValueError: The truth value of an array is ambiguous. Use a.empty, a.any() or a.all().

解释及处理方式请见比较

同时请见陷阱