O'Reilly logo

Learning pandas - Second Edition by Michael Heydt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Transforming data

Another part of tidying data involves transforming the existing data into another presentation. This may be needed for the following reasons:

  • Values are not in the correct units
  • Values are qualitative and need to be converted to appropriate numeric values
  • There is extraneous data that either wastes memory and processing time, or can affect results simply by being included

To address these situations, we can take one or more of the following actions:

  • Map values to other values using a table lookup process
  • Explicitly replace certain values with other values (or even another type of data)
  • Apply methods to transform the values based on an algorithm
  • Simply remove extraneous columns and rows

We have already seen how to delete ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required