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

Exercise

Maximum value last year

Next, you would like to add the maximum amount that a donor donated in 2017, but before May 1st, 2017 to the basetable. You have a few objects available to you: basetable contains the donor IDs of the population, and gifts contains gifts made by donors over time. For each donor in the population, add the maximum amount that this donor donated in 2017 to 'basetable`.

Instructions

100 XP
  • Fill out the start and end date of the period over which you want to take the maximum.
  • Select gifts made in 2017 using these start and end dates in the dataframe gifts_2017.
  • Create a pandas dataframe that has the maximum amount for each donor in gifts_2017.
  • Add this maximum amount to the basetable.