December 2018
Intermediate to advanced
268 pages
8h 23m
English
Preprocessing of the data typically refers to the stage where you read in the data and do basic actions to make the data usable in your domain. In our case, this means we'd like the data in a pandas or NumPy data frame. Their formats are interchangeable with minimal sets of code and hence are used commonly in the data science field. In the following example, you'll get experience reading in a dataset and converting categorical variables to numerical variables. This process can easily be converted to a method later in this chapter.
Here's the recipe:
!/usr/bin/env pythonimport numpy as npimport pandas as pdimport matplotlib.pyplot as plt
Read now
Unlock full access