更新时间:2022-12-12 12:09:17
使用 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)