Challenge: Mutate Customer Data
Tarefa
Swipe to start coding
Practice using mutate() to add new columns for customer segmentation. Your goal is to create an age column and a segment column in the given data frame.
- Add a new column
ageto the data frame, calculated as2024 - birth_year. - Add a new column
segmentto the data frame, assigning "youth" ifageis less than 25, "adult" ifageis 25 or older but less than 65, and "senior" ifageis 65 or older.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 4
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 4.17
Challenge: Mutate Customer Data
Deslize para mostrar o menu
Tarefa
Swipe to start coding
Practice using mutate() to add new columns for customer segmentation. Your goal is to create an age column and a segment column in the given data frame.
- Add a new column
ageto the data frame, calculated as2024 - birth_year. - Add a new column
segmentto the data frame, assigning "youth" ifageis less than 25, "adult" ifageis 25 or older but less than 65, and "senior" ifageis 65 or older.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 4
single