preface
We hope readers will learn about both finance and Python by reading the book. It isn’t intended to teach either of those topics from the ground up—we expect that readers will have a basic understanding of probability and statistics, financial concepts, and Python programming—but accessibility is important to us.
The balance of theory and implementation varies by chapter. Some chapters are very financially focused, and the Python content is limited to showing how a few functions from existing libraries can be used to perform certain calculations or accomplish desired tasks. In other chapters, there aren’t any existing Python libraries we can use. These chapters are much more code-heavy, and we essentially build new Python libraries implementing the concepts they cover. We know reading code isn’t always easy, so we show example usages of new code whenever possible to aid understanding.
Much of the content related to laws or regulations, specific financial products, or types of retirement accounts is United States–focused. We’ve spent our careers in the United States, and the specifics we cover are what we know. However, the concepts we discuss should apply no matter where you live. Often there are non-US equivalents of topics we discuss—for example, a self-invested pension plan (SIPP) is essentially the United Kingdom’s version of a self-directed IRA in the United States.