Challenge: Mutate Customer Data
Compito
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.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 1. Capitolo 4
single
Chieda ad AI
Chieda ad AI
Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione
Fantastico!
Completion tasso migliorato a 4.17
Challenge: Mutate Customer Data
Scorri per mostrare il menu
Compito
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.
Soluzione
Tutto è chiaro?
Grazie per i tuoi commenti!
Sezione 1. Capitolo 4
single