March 2019
Beginner to intermediate
464 pages
10h 57m
English
Next, let's look at how we can encode the different categories of the job column. We will first look at the unique values in this column, using the following code:
df['job'].unique()
The unique values in the job column look as follows:

As you can see in this output, there is no natural ordering for this variable. One job category does not precede the other, so we cannot encode this variable like we did for month. We are going to create dummy variables for each of the job categories. If you recall from the previous chapter, a dummy variable is a variable that is encoded with 1 if a given record belongs to the category, and 0
Read now
Unlock full access