Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge | Preprocessing Data: Part II
Data Manipulation using pandas

Swipe to show menu

book
Challenge

Let's replace the negative values in the 'empinch' and 'invsth' columns with zeros using the .where() method.

Task

Swipe to start coding

  1. Select the 'empinch' and 'invsth' columns.
  2. Apply the .where() method to chosen columns.
  3. Set the condition what values must be replaced (these must be negative values). Remember, values that don't satisfy this condition will be replaced.
  4. Set the parameter what values must be used instead of replaced ones.

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Β 2. ChapterΒ 5
We're sorry to hear that something went wrong. What happened?

Ask AI

expand
ChatGPT

Ask anything or try one of the suggested questions to begin our chat

book
Challenge

Let's replace the negative values in the 'empinch' and 'invsth' columns with zeros using the .where() method.

Task

Swipe to start coding

  1. Select the 'empinch' and 'invsth' columns.
  2. Apply the .where() method to chosen columns.
  3. Set the condition what values must be replaced (these must be negative values). Remember, values that don't satisfy this condition will be replaced.
  4. Set the parameter what values must be used instead of replaced ones.

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Β 2. ChapterΒ 5
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