Best way to subset a pandas dataframe [closed]
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed last year . Hey I'm new to Pandas and I just came across df.query() . Why people would use df.query() when you can directly filter your Dataframes using brackets notation ? The official pandas tutorial also seems to prefer the latter approach. With brackets notation : df[df['age'] <= 21]