Challenge: Mutate Customer Data
Tâche
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.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 1. Chapitre 4
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion
Génial!
Completion taux amélioré à 4.17
Challenge: Mutate Customer Data
Glissez pour afficher le menu
Tâche
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.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 1. Chapitre 4
single