df.filter: Filter Columns Based on a Subset of Their Names

df.filter: Filter Columns Based on a Subset of Their Names

If you want to filter columns of a pandas DataFrame based on characters in their names, use DataFrame.filter. In the example above, we only choose the columns that contain the word “cat”.

My previous tips on filtering a pandas DataFrame.

Search

Scroll to Top

Work with Khuyen Tran

Work with Khuyen Tran