← Back to Cashflow Modelling in Python

Input data

Fantastic work with a tricky question about the term annuity! In this lesson, we will prepare the input data for our new model.

In this part, you will prepare the input data: policy data (model point set) and the interest rate.

Policy data (model point set)

In the input.py file, prepare data for the insured people. Use the ModelPointSet class and create a table (DataFrame). Call your model point set policy.

Add data for two people:

  • person 1: benefit 2,000 EUR, monthly death probability 0.004, remaining term 120 months,
  • person 2: benefit 3,000 EUR, monthly death probability 0.005, remaining term 48 months.

Fill in the code:

# input.py

from cashflower import ModelPointSet
import pandas as pd

policy = ModelPointSet(data=pd.DataFrame({
    "id": [1, 2],
    "benefit": [_____, _____],
    "mortality_rate": [_____, _____],
    "remaining_term": [_____, _____],
}))

Task: Fill in the missing values based on the data above.

Market assumptions

Assume the monthly interest rate is 0.3%. Save it as a scalar variable interest_rate in the same file (input.py).


# input.py

interest_rate = _____

Task: Enter the interest rate as a decimal number. You do not need to convert to yearly rate.

  Next