Running Present Value Example Ep.2#

This notebook runs present_value_ep2.py and output results in tables. The result tables replicate figures shown in this tutorial video on Systemortph’s YouTube channel.

To run this notebook, the ifrs17 and present_value_ep2 modules in your copy of the ifrs17a library need to be importable. To ensure they are importable, make sure the current directory is set to your ifrs17a copy. Typically, the current directory is set to the location where you started this notebook, so it should run fine unless you have moved the notebook elsewhere. To check the current directory from Python, import os, and execute os.getcwd(). To change the current directory in Python, use the os.chdir function.

Running present_value_ep2.py#

present_value_ep2.py is executed when it’s imported by the import statement. ifrsvars defined in the template module refers to a DataFrame that contains all the IFRS variables as rows.

[3]:
import pandas as pd
from present_value_ep2 import ifrsvars as vars

The DataFrame below replicates figures in the table in the video, Systemorph #Techucation for IFRS17: Present Value with our Notebook

[5]:
df = vars[(vars['EconomicBasis'] == 'L') & (vars['EstimateType'] == 'BE')].set_index(
    ['Novelty', 'AocType', 'AmountType'])['Value'].groupby(level=[0, 1, 2]).sum().unstack(level=2)
df
[5]:
AmountType CL PR
Novelty AocType
C EOP 11459.723798 -14323.349204
N AU -770.405525 -1068.926528
BOP 11364.693439 -17128.546413
CF -240.320160 2210.550000
EV 916.777904 1913.390722
IA 188.978140 -249.816985