.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated_examples\fastlife\plot_pvnetcf_by_issue_age.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_generated_examples_fastlife_plot_pvnetcf_by_issue_age.py: fastlife: Present values of net cashflows =============================================== .. seealso:: * :mod:`~fastlife` library .. GENERATED FROM PYTHON SOURCE LINES 8-34 .. rst-class:: sphx-glr-horizontal * .. image-sg:: /generated_examples/fastlife/images/sphx_glr_plot_pvnetcf_by_issue_age_001.png :alt: PV Net Cashflow by Issue Age, Product: TERM :srcset: /generated_examples/fastlife/images/sphx_glr_plot_pvnetcf_by_issue_age_001.png :class: sphx-glr-multi-img * .. image-sg:: /generated_examples/fastlife/images/sphx_glr_plot_pvnetcf_by_issue_age_002.png :alt: PV Net Cashflow by Issue Age, Product: WL :srcset: /generated_examples/fastlife/images/sphx_glr_plot_pvnetcf_by_issue_age_002.png :class: sphx-glr-multi-img * .. image-sg:: /generated_examples/fastlife/images/sphx_glr_plot_pvnetcf_by_issue_age_003.png :alt: PV Net Cashflow by Issue Age, Product: ENDW :srcset: /generated_examples/fastlife/images/sphx_glr_plot_pvnetcf_by_issue_age_003.png :class: sphx-glr-multi-img .. code-block:: default import matplotlib.pyplot as plt import seaborn as sns sns.set_theme(style="darkgrid") import modelx as mx proj = mx.read_model("model").Projection pols = proj.Policy.PolicyData() for prod in ["TERM", "WL", "ENDW"]: fig, ax = plt.subplots() fig.suptitle('PV Net Cashflow by Issue Age') ax.set_title('Product: ' + prod) title = 'Product: ' + prod ax.set_xlabel('Issue Age') ax.set_ylabel('PV Net Cashflow') for sex, marker in zip(["M", "F"], ["o", "^"]): filter = (pols.Product == prod) & ( pols.Sex == sex) & (pols.IssueAge < 60) ages = proj.Policy.IssueAge().loc[filter] pvcfs = proj.PV_NetCashflow(0).loc[filter] ax.scatter(ages, pvcfs, marker=marker) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 3.894 seconds) .. _sphx_glr_download_generated_examples_fastlife_plot_pvnetcf_by_issue_age.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_pvnetcf_by_issue_age.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_pvnetcf_by_issue_age.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_