March 2019
Beginner to intermediate
464 pages
10h 57m
English
If you look closely at the data, you will notice that there are some records with no CustomerID. Since we need to build a customer-item matrix, where each row is specific to each customer, we cannot include those records with no CustomerID in our data. Let's first take a look at how many records do not have a CustomerID.
Take a look at the following code:
# there are 133,361 records with no CustomerIDsum(is.na(df$CustomerID))
The is.na function that we are using here detects missing values and returns TRUE for each of the missing values. By summing over these values using the sum function, we can count the number of records with no CustomerID. The result looks as follows:
As you can see from this ...
Read now
Unlock full access