Pick Columns by Name
Single columns and column lists.
Columns Are Your Starting Point
Real datasets have dozens of columns, but you rarely need them all. Picking the right columns by name is the first move in almost every analysis. 🎯
Grab One Column
To pull a single column, put its name in square brackets after the DataFrame. What you get back is a one-dimensional Series.
ages = df["age"]
print(ages.head())