Skip to Content
Financial Modelling in Python
book

Financial Modelling in Python

by Shayne Fletcher, Christopher Gardner
August 2009
Intermediate to advanced
244 pages
9h 5m
English
Wiley
Content preview from Financial Modelling in Python
P1: JYS
c02 JWBK378-Fletcher May 1, 2009 19:51 Printer: Yet to come
The PPF Package 7
Trying:
print black
scholes(S=42., K=40., r=0.1, sig= 0.2, T=0.5, CP=PUT)
Expecting:
0.808598915338
ok
2 items had no tests:
main
main . test
1 items passed all tests:
2 tests in
main .black scholes
2 tests in 3 items.
2 passed and 0 failed.
Test passed.
2.2.2 PyUnit
A full suite of unit tests for all modules in the ppf package is provided in the ppf.test
sub-package. The tests can be run module-by-module or, to execute all tests in one go, a driver
‘test
all.py’ is provided:
C:\Python25\Lib\site-packages\ppf\test>python test all.py --verbose
python test
all.py --verbose
test
call (test core.black scholes tests) ... ok
test
put (test core.black scholes tests) ... ok
test (test
core.libor rate tests) ... ok
.
.
.
test
upper bound (test utility.bound tests) ... ok
test
equal range (test utility.bound tests) ... ok
test
bound (test utility.bound tests) ... ok
test
bound ci (test utility.bound tests) ... ok
--------------------------------------------------------------------
Ran 51 tests in 25.375s
OK
2.3 BUILDING AND INSTALLING PPF
In this section we look at what it takes to build and install the ppf package.
2.3.1 Prerequisites and Dependencies
ppf is composed of a mixture of pure Python modules underlied by some supporting extension
modules implemented instandard C++. Accordingly, to build and install ppf requiresa modern
C++ compiler. The C++ ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Hands-On Simulation Modeling with Python

Hands-On Simulation Modeling with Python

Giuseppe Ciaburro

Publisher Resources

ISBN: 9780470987841Purchase book