Challenge: Mutate Customer Data
Taak
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.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 1. Hoofdstuk 4
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Geweldig!
Completion tarief verbeterd naar 4.17
Challenge: Mutate Customer Data
Veeg om het menu te tonen
Taak
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.
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 1. Hoofdstuk 4
single