Python的DataFrame多个条件过滤错误

执行的代码:

image.png

1、报错如下:

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

image.png

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

image.png

猜你喜欢

转载自blog.51cto.com/12831900/2371967