Pandas 3.1 `select` method: Retrieving specific columns

Pandas 3.1 `select` method: Retrieving specific columns

Want to retrieve specific columns from your Python Pandas data frame? In the past, you would say

df[['x', 'y']]

But now, with version 3.1, you can use the “select” method:

df.select('x', 'y')