Writing a financial calculator in Python

When discussing the various concepts of the time value of money, learners need a financial calculator or Excel to solve various related problems.

From the preceding illustrations, it is clear that several functions, such as scipy.pv(), could be used to estimate the present value of one future cash flow or present value of annuity. Actually, the functions related to finance contained in the SciPy module came from the numpy.lib.financial submodule:

>>> import numpy.lib.financial as fin >>> dir(fin) ['__all__', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__spec__', '_convert_when', '_g_div_gp', '_rbl', '_when_to_num', 'absolute_import', 'division', 'fv', 'ipmt', ...

Get Python for Finance - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.