df.query: Query Columns Using Boolean Expression

df.query: Query Columns Using Boolean Expression

It can be lengthy to filter columns of a pandas DataFrame using brackets. To shorten the filtering statements, use df.query instead.

Link to the Google Colab of this tip.

Link to my previous tips on pandas.

Scroll to Top

Work with Khuyen Tran

Work with Khuyen Tran