Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Select Data Based on Condition | Dealing With Conditions
course content

Course Content

Advanced Techniques in pandas

Select Data Based on ConditionSelect Data Based on Condition

To excel in programming, you always need to practice. So, in this task, you must also memorize functions from the previous chapter. If you aren't solid on the functions from the last chapter, look at the hints to revise them.

Task

  1. Extract all rows from the columns 'name' and 'hazardous' using the .loc[] function.
  2. Filter data; extract rows where 'hazardous' is True.
  3. Output the first five rows of the data_filtered dataset.

Everything was clear?

Section 2. Chapter 2
toggle bottom row
course content

Course Content

Advanced Techniques in pandas

Select Data Based on ConditionSelect Data Based on Condition

To excel in programming, you always need to practice. So, in this task, you must also memorize functions from the previous chapter. If you aren't solid on the functions from the last chapter, look at the hints to revise them.

Task

  1. Extract all rows from the columns 'name' and 'hazardous' using the .loc[] function.
  2. Filter data; extract rows where 'hazardous' is True.
  3. Output the first five rows of the data_filtered dataset.

Everything was clear?

Section 2. Chapter 2
toggle bottom row
some-alt