Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Python for Finance
  • Toc
  • feedback
Python for Finance

Python for Finance

By : Yuxing Yan
3.9 (22)
close
Python for Finance

Python for Finance

3.9 (22)
By: Yuxing Yan

Overview of this book

A hands-on guide with easy-to-follow examples to help you learn about option theory, quantitative finance, financial modeling, and time series using Python. Python for Finance is perfect for graduate students, practitioners, and application developers who wish to learn how to utilize Python to handle their financial needs. Basic knowledge of Python will be helpful but knowledge of programming is necessary.
Table of Contents (14 chapters)
close
13
Index

Generating our own module


The math module has more than two dozen functions, such as the pow(), sin(), and ceil() functions. It is definitely a good idea to have just one program or file or package or module to include all of them. Let's start from the simplest case of two functions. The first function is the pv_f() function we discussed before. Our second function is the present value of perpetuity, which has constant cash flow at the same interval forever. If the first cash flow occurs at the end of the first period, we have the following formula:

Here, c is the constant periodic cash flow occurring at the end of each period, and R is the periodic discount rate. For example, if we are expected to receive $10 at the end of each year forever, and the first cash flow would happen at the end of the first year, then the present value of such a perpetuity is $100 (10 / 0.1) if the annual discount rate is 10 percent.

Again, we need to navigate to File | (Choose) A new Window (Ctrl+N), and then...

bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete