Skip to content
skillbld
Day 3 of 14 30 minloc / ilocBoolean filtersquery()

Pick exactly the rows and columns you need. Select columns, filter rows with conditions, use loc and iloc, combine conditions, and write readable filters with isin, between and query.

By the end of today you can

  • Select one or several columns
  • Filter rows with boolean conditions and combine them with & and |
  • Choose rows and columns by label with loc and by position with iloc
  • Use isin(), between() and str.contains() for common filters
  • Write readable filters with query()

What's inside

  • 7 sections
  • 3 diagrams and mind maps
  • 9 code examples you can run
  • 5-question quiz
  1. 1Our dataset
  2. 2Selecting columns
  3. 3Filtering rows with conditions
  4. 4Handy filter helpers
  5. 5query(): filters that read like sentences
  6. 6loc: rows and columns by label
  7. 7iloc: rows and columns by position

Sign in free to read this lesson

Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.

Sign in free
Day 3: Selecting Data · Data Analysis with pandas · SkillBld