Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Dropping Null Values | Analyzing the Data
Pandas First Steps
course content

Course Content

Pandas First Steps

Pandas First Steps

1. The Very First Steps
2. Reading Files in Pandas
3. Analyzing the Data

book
Challenge: Dropping Null Values

If the dataset has rows with null values, we should consider removing them. In pandas, this can be achieved using the dropna() method.

Task
test

Swipe to show code editor

  1. Find the length of wine_data before removing null values and assign the result to the length_before variable.
  2. Remove rows with null values.
  3. Find the length of wine_data after removing null values and assign the result to the length_after variable.
  4. Print the number of removed rows based on the length_before and length_after variables.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 8
toggle bottom row

book
Challenge: Dropping Null Values

If the dataset has rows with null values, we should consider removing them. In pandas, this can be achieved using the dropna() method.

Task
test

Swipe to show code editor

  1. Find the length of wine_data before removing null values and assign the result to the length_before variable.
  2. Remove rows with null values.
  3. Find the length of wine_data after removing null values and assign the result to the length_after variable.
  4. Print the number of removed rows based on the length_before and length_after variables.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 3. Chapter 8
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt