可能是一个简单的答案,所以提前道歉(最少的编码经验)。我试图从任何列中删除具有特定字符串(经济 7)的任何行,并且一直试图离开这个线程:无法让它工作,但在以前的数据帧(现在是 df = energy)上尝试了这段代码,它似乎可以工作,尽管现在出现了一个错误:no_eco = energy[~energy.apply(lambda series: series.str.contains('Economy 7')).any(axis=1)]AttributeError: ('Can only use .str accessor with string values, which use np.object_ dtype in pandas', 'occurred at index existingProductCodeGas')有什么建议么?ps DataFrame 非常大。
添加回答
举报
0/150
提交
取消