执行的代码:

Python的DataFrame多个条件过滤错误_Python

1、报错如下:

ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Python的DataFrame多个条件过滤错误_条件过滤_02

2、应该修改如下(注:别忘记了表达式两边加括号):

Python的DataFrame多个条件过滤错误_Python_03