Challenge: Transformation Grid
Tarefa
Swipe to start coding
You are given the Titanic dataset from the seaborn library.
Your goal is to perform data transformation using pandas and scikit-learn.
Perform the following steps:
- Load the dataset with
sns.load_dataset("titanic"). - Fill missing values in
ageandembarked(mean and mode). - Encode the categorical columns
sexandembarkedusingpd.get_dummies()(drop the first category to avoid redundancy). - Scale the numeric columns
ageandfareusingStandardScaler. - Create a new column
family_size = sibsp + parch + 1. - Return the transformed dataset as
transformed_data.
Print .head() to preview the result.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 8
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Incrível!
Completion taxa melhorada para 8.33
Challenge: Transformation Grid
Deslize para mostrar o menu
Tarefa
Swipe to start coding
You are given the Titanic dataset from the seaborn library.
Your goal is to perform data transformation using pandas and scikit-learn.
Perform the following steps:
- Load the dataset with
sns.load_dataset("titanic"). - Fill missing values in
ageandembarked(mean and mode). - Encode the categorical columns
sexandembarkedusingpd.get_dummies()(drop the first category to avoid redundancy). - Scale the numeric columns
ageandfareusingStandardScaler. - Create a new column
family_size = sibsp + parch + 1. - Return the transformed dataset as
transformed_data.
Print .head() to preview the result.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 8
single