October 2018
Intermediate to advanced
134 pages
2h 39m
English
We will build our dataset using a custom pandas DataFrame and then we will redefine the DataFrame based on the information that we have imported. Each column in a DataFrame is called a series. We will start by making a series for each column, using the data.loc[] method, and then printing the first five classes as shown in the following code snippet:
classes = data.loc[:, 'Class']print(classes[:5])
In the first five rows, we have the Class column, all pluses (+) or minuses (-). The pluses, in this case, are the promoters, while the minuses are anything that isn't a promoter. Take a look at the following screenshot:

Read now
Unlock full access