Python for Finance

Errata for Python for Finance

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date Submitted Date Corrected
Other Digital Version
figure 16-2 ebook version
figure 16-2 in ebook version: kindle location 21322

I implemented the author's python code in chapter 16, and was unable to accurately reproduce figure 16-2 exactly (I was able to reproduce figure 16-1 exactly). My blue lines are slightly different (a few percent) from the figure blue lines, but more importantly the red lines are significantly different in the upper half of the figure. The book figure (in my kindle version) shows what appear to be three red lines exactly overlapping blue lines in the upper part of the figure, which is apparently an error, given the stochastic nature of the lines. Also, one would expect a symmetric up/down dispersion of red lines, but they cluster towards the bottom of the book figure. I would be happy to submit my version of figure 16-2 at your request. I'm running mavericks on a macbook pro. Warren Smith

Note from the Author or Editor:
The figure is indeed not correct for multiple simulated paths -- the correct figure can be found in the IPython Notebooks hosted under or eg here (see output promt [39]):

Warren Smith  Jun 02, 2015 
Page 69
pandas import AND call to web.DataReader

"import as web" gives an error, apparently solved by "import " as web" However, running the DataReader command: web.DataReader('^GSPC' ... then gives a ConnectionError. It is given below. The Yahoo server being sourced is extinct. Is there a workaround? I run Python 2.7.11 on Canopy 1.7.4 ConnectionError: HTTPConnectionPool(host='', port=80): Max retries exceeded with url: /table.csv?a=0&ignore=.csv&s=%5EGSPC&b=1&e=14&d=3&g=d&f=2014&c=2000 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000000000AFF1B70>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))

Note from the Author or Editor:
The problem here is well known. Yahoo has stopped the service. Code changes/updates are found in the repo:

Jonathan Schachter  Sep 21, 2017 
Page 269
Table 10-2

Function lognormalv should be just lognormal (no v at the end).

Note from the Author or Editor:
On page 287: the "v" is indeed to be deleted after "lognormal"

Camilla Montonen  Aug 23, 2015 
Page 273
Top of page

Sentence "Figure 10-4 shows the output of the following simulation code:" splits the IPython cells of the simulation code into two. The code that follows this sentence is not actually the simulation code, but the plotting code. The simulation code appears before this sentence.

Note from the Author or Editor:
On page 291: the word "simulation" is to be deleted in the sentence "Figure 10-4 shows the output of the following SIMULATION code:"

Camilla Montonen  Aug 23, 2015