在列表中使用“not in list”语法

2024-04-28 06:41:38 发布

您现在位置:Python中文网/ 问答频道 /正文

我正试着做一些像

exclude_values = range(low, high)  # for the sake of example
df = df[df['blah'] not in exclude_values]

这就提出了“真值序列是模糊的”例外。问题是,我看不出如何更改此语法以避免使用not in。我遗漏了什么(可能是非常明显的)


Tags: oftheindfforexamplenotrange