I was checking out the answer to this question and had a quick follow-up question. The answer says that in case of multiple conditions parentheses are required since operator "&" is more binding than comparison operators:
df.loc[(df['column_name'] >= A) & (df['column_name'] <= B)]
And missing parentheses here will result in 'value ambiguous' error.
Looking at operator precedence rules I noticed that and
is less binding than comparison operators. In this case can the same be re-written like this?
df.loc[df['column_name'] >= A and df['column_name'] <= B]