Filtering DataFrames with the .query() Method in Pandas

Posted 2021-02-19 • Last updated 2021-10-15

Pandas provides a .query() method on DataFrame’s with a convenient string syntax for filtering DataFrames. This post describes the method and gives simple usage examples.

Iterating Over Rows in Pandas

Posted 2021-01-29 • Last updated 2021-10-15

When you absolutely have to iterate over rows in a Pandas DataFrame, use the .itertuples() method.

Dropping Columns and Rows in Pandas

Posted 2021-01-14 • Last updated 2021-10-15

There are a few ways to drop columns and rows in Pandas. This post describes the easiest way to do it and provides a few alternatives that can sometimes be useful.

How to Use the Pandas Melt Command

Posted 2020-12-22 • Last updated 2021-10-15

The Pandas melt command unpivots tabular data, transforming it from wide to long format. To understand this operation, you have to know…