更新时间:2022-12-12 12:00:27
使用 between
与 inclusive=False
表示严格不等式:
Use between
with inclusive=False
for strict inequalities:
df['two'].between(-0.5, 0.5, inclusive=False)
inclusive
参数决定是否包含端点(True
: <=
, False
: <
).这适用于两个标志.如果您想要混合不等式,则需要明确编码:
The inclusive
parameter determines if the endpoints are included or not (True
: <=
, False
: <
). This applies to both signs. If you want mixed inequalities, you'll need to code them explicitly:
(df['two'] >= -0.5) & (df['two'] < 0.5)