1. Engineering
  2. Computer Science
  3. i need some lines of pandas python code that will...

Question: i need some lines of pandas python code that will...

Question details

I need some lines of pandas python code that will take a data frame where there is an age variable, and:

1. create a new variable "Descritized Age"

2. assign each observation into the following categories, based on the "age" variable

     a. 18-35: "young"

     b. 36-55: "mid-age"

     c. 56-older: "old"

3. Move this new "Descritized Age" variable column to one column to the right of the existing "age" column

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution