course content

Course Content

Data Manipulation using pandas


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


  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.

Everything was clear?

Section 2. Chapter 5
toggle bottom row