1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Financial Concepts in Python

Exercise

Cumulative payments and home equity

You are faithfully paying your mortgage each month, but it's difficult to tell how much of the house you actually own and how much interest you have paid in total over the years.

Use np.cumsum() to add up all the interest payments and also to add up all the principal payments over time to see how your ownership changes over time.

Recall that np.cumsum() performs a cumulative sum over time. Return a series of iterative sums instead of just a single number.

principal_paid, interest_paid, home_value and down_payment_percent from the previous exercise are available.

Instructions

100 XP
  • Calculate your cumulative_home_equity over time using np.cumsum() on the principal paid.
  • Repeat the process with cumulative_interest_paid.
  • Calculate your percentage home equity over time (don't forget to add the down payment!).