Dataframe 中的 and vs &

refer to:

http://dougaoyang.github.io/2017/09/22/pandas-bool-compare.html

 

df[(df['pop']>3) and (df['pop']<4)]

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

 

需要用  &

posted @ 2019-01-07 14:47  清源居士  阅读(963)  评论(0编辑  收藏  举报