Practice Selecting and Filtering Data - 4.6 | Chapter 4: Understanding Pandas for Machine Learning | Machine Learning Basics
Students

Academic Programs

AI-powered learning for grades 8-12, aligned with major curricula

Professional

Professional Courses

Industry-relevant training in Business, Technology, and Design

Games

Interactive Games

Fun games to boost memory, math, typing, and English skills

Selecting and Filtering Data

4.6 - Selecting and Filtering Data

Enroll to start learning

You’ve not yet enrolled in this course. Please enroll for free to listen to audio lessons, classroom podcasts and take practice test.

Learning

Practice Questions

Test your understanding with targeted questions

Question 1 Easy

What command would you use to select the 'Name' column?

💡 Hint: Use single brackets for a single column.

Question 2 Easy

How do you filter for ages greater than 30?

💡 Hint: Use the greater than operator inside the brackets.

4 more questions available

Interactive Quizzes

Quick quizzes to reinforce your learning

Question 1

What will df[['Name']] return?

A Series
A DataFrame
An error

💡 Hint: Think about the brackets you use.

Question 2

True or False: Filtering allows you to remove rows based on certain conditions.

True
False

💡 Hint: Consider what filtering does to the data you see.

1 more question available

Challenge Problems

Push your limits with advanced challenges

Challenge 1 Hard

Given the following DataFrame 'students', write a command to extract names of students who scored above 80 and attended more than 5 hours.

💡 Hint: Use logical operators to combine multiple conditions.

Challenge 2 Hard

If you have a DataFrame of sales data, and you want to extract the 10 recent sales transactions above $1000, how would you approach this?

💡 Hint: Filter first, then use head to limit your results.

Get performance evaluation

Reference links

Supplementary resources to enhance your learning experience.