0PricingLogin
Data Science Academy · Lesson

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())

All lessons in this course

  1. Pick Columns by Name
  2. Filter Rows With Conditions
  3. Combine Filters With AND and OR
  4. query and isin for Clean Filters
← Back to Data Science Academy