Book Image

Python for Finance

By : Yuxing Yan
Book Image

Python for Finance

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)
13
Index

Looping through an array


We could iterate over an array. The following code example prints each cash flow:

>>>import numpy as np
>>>cash_flows=np.array([-100,50,40,30,25,-10,50,100])
>>>for cash in cash_flows:
        print x