使用Dataframe遇到的一些问题

 

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

Dataframe切片过程中,若需满足多个逻辑条件,要使用& 和|,在某些条件下用and/ or会报错,参考链接

x_1 = x_data[x_data['s_line'] > 6 & x_data['p_wid'] > 0]

 

posted @ 2021-06-24 10:25  浅忆~  阅读(229)  评论(0编辑  收藏  举报