How to select rows in a DataFrame between two values, in Python Pandas?
Consider also series between:
df = df[df['closing_price'].between(99, 101)]
You should use ()
to group your boolean vector to remove ambiguity.
df = df[(df['closing_price'] >= 99) & (df['closing_price'] <= 101)]