Pandas: Simplify filter expressions with between

less than 1 minute read

You can reduce this filter:

df[(df.price >= 2) & (df.price <= 4)]

to:

df[df.price.between(2, 4)]

Comments