pandas中loc函数使用时报错ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool()...
·
想查询价格那一列下1500~2000的数据
也就是说1500<价格<=2000
如下报错写法:data.loc[(800<data['售价']<=1000)]

正确修改:
data.loc[(800<data['售价']) & (data['售价']<=1000)] ,就可以了
更多推荐



所有评论(0)