1. Learn
  2. /
  3. Courses
  4. /
  5. Intermediate Predictive Analytics in Python

Exercise

Adding age

Given is an early stage basetable that contains the donor ID and birth date of candidate donors. In this exercise you will learn to add the age of these donors to the basetable. The method to calculate "age" is already implemented for your convenience. Keep in mind the following timeline of the basetable:

Instructions

100 XP
  • Fill out the reference date.
  • Add a column "age" to the basetable that is the age of the donor on the reference date. The function calculate_age has been implemented for you. It takes date_of_birth and reference_date as arguments.
  • Print the mean age of all donors.