"How to filter the DataFrame rows of pandas by ""within""/""in""?",b = df[(df['a'] > 1) & (df['a'] < 5)]