Challenge: Mutate Customer Data
Aufgabe
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.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 1. Kapitel 4
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
Großartig!
Completion Rate verbessert auf 4.17
Challenge: Mutate Customer Data
Swipe um das Menü anzuzeigen
Aufgabe
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.
Lösung
War alles klar?
Danke für Ihr Feedback!
Abschnitt 1. Kapitel 4
single