2024-04-28 06:41:38 发布
网友
我正试着做一些像
exclude_values = range(low, high) # for the sake of example df = df[df['blah'] not in exclude_values]
这就提出了“真值序列是模糊的”例外。问题是,我看不出如何更改此语法以避免使用not in。我遗漏了什么(可能是非常明显的)
not in
使用isin
isin
df[~df['blah'].isin(exclude_values)]
使用惯用方法和位逻辑:
df = df[~round(df.blah).isin(exclude_values)]
使用
isin
使用惯用方法和位逻辑:
相关问题 更多 >
编程相关推荐