Pandas DataFrame: How to select all columns that start with a word

If you want to choose the columns that start with a word, use df.columns.str.startwith('word'). Above is an example.

The columns that are False will not be returned

Scroll to Top

Work with Khuyen Tran

Work with Khuyen Tran