Question: Assuming we want to run analysis using variables: Survived, Pclass, Sex, Age, Fare, Embarked, and want to prepare a dataset for the analysis. Please do
- Assuming we want to run analysis using variables: Survived, Pclass, Sex, Age, Fare, Embarked, and want to prepare a dataset for the analysis. Please do the items below:
- Create a subset of data which only contains selected variables. This should be a new Python variable only containing selected columns.
- For each variable, please check whether it has any missing values. If yes, how many missing values are there. If you see missing values on variables Survived, Pclass, Sex, Embarked, please removing the missing records.
- For missing values on variables Age, Fare, please replace the missing value using average age and average fare.
- If you identify any categorical variable(s), please use one-hot encoding to convert the variables.
- At the end, please print the final dataset, which only contains selected variable and is well cleaned. Please indicate the number of observations in the dataset.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
