How it works...

First, we extract all the columns with their corresponding datatypes.

We have already discussed the .dtypes property of DataFrame stores in the previous recipe.

We will only keep label, which is the column that holds an identifier regarding whether a person makes more than $50,000 or not, and a handful of other numeric columns. In addition, we carry over all the string features. 

Next, we create a DataFrame with only the selected columns and extract all the numeric and categorical columns; we store these in the cols_num and cols_cat lists, respectively.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset