Question: I'm working on a data frame called 'contestants info' that has the columns 'season number', 'contestant name', 'contestant id', gender', 'ethnicity', 'date of birth', and
I'm working on a data frame called 'contestants info' that has the columns 'season number', 'contestant name', 'contestant id', gender', 'ethnicity', 'date of birth', and 'personality type'. I want to make a new dataframe called 'prediction' that does the following: (1) creates dummy columns (using get_dummies) for the original personality type column, (2) adds a prefix called "type"
,(3) drops the first column to help prevent multicollinearity, and (4) uses the dtype=int argument
The columns should be 'contestant id', 'contestant name' followed by the various dummy columns for the personality types.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
