Jump to ratings and reviews
Rate this book

Python for Finance: Mastering Data-Driven Finance

Rate this book
All Indian Reprints of O'Reilly are printed in Grayscale.

The financial industry has recently adopted Python at a tremendous rate, with some of the largest investment banks and hedge funds using it to build core trading and risk management systems. Updated for Python 3, the second edition of this hands-on book helps you get started with the language, guiding developers and quantitative analysts through Python libraries and tools for building financial applications and interactive financial analytics.

Using practical examples throughout the book, author Yves Hilpisch also shows you how to develop a full-fledged framework for Monte Carlo simulation-based derivatives and risk analytics, based on a large, realistic case study. Much of the book uses interactive IPython Notebooks.

716 pages, Paperback

First published October 1, 2012

271 people are currently reading
979 people want to read

About the author

Yves Hilpisch

11 books27 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
54 (22%)
4 stars
103 (42%)
3 stars
67 (27%)
2 stars
14 (5%)
1 star
5 (2%)
Displaying 1 - 17 of 17 reviews
Profile Image for Łukasz Słonina.
124 reviews25 followers
September 29, 2019
Very good book on applying Python to finance. I was hoping to learn both (or at least understand more finance aspect), but the assumption is that you should know finance, and this book is focusing on applying Python, not on learning finance.
Profile Image for Dennis Cahillane.
115 reviews8 followers
August 30, 2020
The perfect book for someone who knows math and software engineering, but not the Python Scientific Stack and basic vectorization techniques to optimize backtesting trading algorithms. I recommend typing in the sample code any time you're not 100% following along, even though that is much slower than simply plowing ahead. Also, buy the Kindle version of the book to view the plots in color, I can't distinguish between the line colors in the printed version of the book.
40 reviews19 followers
October 30, 2020
A good read for any finance Quant. Code examples are great. I like his code style. He builds up the DX package gradually which is pedagogical.
Profile Image for Alex.
586 reviews46 followers
February 16, 2018
This makes for a very good "grand tour" of a lot of the practical financial uses of a handful of important Python libraries, and illustrates well how to combine the functionality they offer into a fairly coherent financial application library for derivatives valuation. If one doesn't already have at least a bit of background in both Python and some aspects of financial valuation, there may be a little less value for the reader here -- most chapters touch on topics that are worthy of books in their own right, so some preexisting knowledge (or willingness to go find and read those other books to answer questions) is assumed. Generally, though, a useful resource, and while some of the underlying libraries have evolved since this was published, the presentation is general enough that a motivated reader could figure out how to make the appropriate updates for similar applications of their own.
Profile Image for Benji.
349 reviews74 followers
February 4, 2019
Shows how straightforward the application of ML algorithms to financial data is, at least in a technical sense.
Practically, a number of important topics need to be considered, see e.g. Advances in Financial Machine Learning (2018) by Marcos López de Prado.

Profile Image for Amine .
5 reviews
July 27, 2021
This is a broad introduction to Python, really useful if you are new to Python and even programming in general. There are good chapters on Black and Scholes derivative pricing and on portfolio optimization, but I wish there were fewer fillers (such as using Excel in Python) and the author had more self-confidence to write mostly on financial applications. It is true that access to Microsoft Excel files is paramount when dealing with financial data. Yet, this is also something that can be learnt quite quickly online. Readers should know that his other book, on derivative pricing, is a significantly more insightful book, with extremely detailed examples -- a treat, really. So depending on your initial programming and maths level, you may want to start with this one, or with Hilpisch's other more advanced books.
40 reviews19 followers
September 14, 2020
Good code. He introduces new functionality gradually in the dx package Read on kindle so math formulas didn't work but I know them from before.
Profile Image for Ferhat Culfaz.
268 reviews18 followers
January 24, 2021
Good practical book, especially for mix of algo trading, portfolio allocation ,option strategies.
Profile Image for Zhijing Jin.
347 reviews61 followers
December 12, 2022
Helpful when I was doing an undergraduate research project on financial data.
Profile Image for JDK1962.
1,421 reviews20 followers
August 27, 2016
My June "work book" in my work-book-a-month effort, that obviously took me far longer to get through than I thought it would.

Useful intro to Python to someone in the financial field, especially with regard to identifying the 3rd party libraries of interest. Some of the specific financial topics were less interesting to me (e.g., option pricing) than others, and some of the examples--early on especially--would have benefited from immediate use of concrete examples, rather than using random number sets, since the motivation was sometimes unclear. But I was grateful for the amount of code...I always learn better from examples.

Not quite sure where the reference to "big [financial] data" was coming from in the subtitle. The term "big data" typically refers to using a data set that can't fit in memory. I don't think any of the examples actually addressed big data (or the topics that come along with it, such as distributed servers or databases, multiple cores, or explicit parallelization of code).
75 reviews8 followers
September 3, 2022
Bought this out of curiosity, to maybe try and do any automated financial analysis for my investments. The book is trying to do too much. It's 300+ (more than half!) pages introduction to Python, introduction to numpy & pandas, and introduction into high Python performance. Only then we go into mathematical methods, 2 pages per method, nothing substantial, but a formula, a graph and a piece of code with a paragraph of description of what it is. Then the book becomes intro to statistics.

Around page 500 it goes into algorithmic trading, but the problem is that the examples use some proprietary API that you need to pay to get access to. (And I did my research - there are more accessible options out there!)

Only from pages 550 to 650 it has some interesting stuff, but there's another problem. There's just code with a few explanations of what specific lines do. Wouldn't be a big deal, but as a software engineer I can tell you the code is awful - difficult to read and understand.

I'll probably use this book to lift a monitor. Two stars.
This entire review has been hidden because of spoilers.
144 reviews5 followers
June 7, 2024
The book excels at conceptually translating theoretical finance calculations (specifically in the subdomain of trading) and applying them to Python. The author correctly makes the claim that the book will not teach you finance (but the material is nothing more difficult than a MBA-level investments class - or a particularly quantitative upperclassman undergrad class).

I did knock a star away for some of the python choices. I suppose I understand that using Python for data science leaves a bit of room to be unpythonic that wouldn't be present in standard development, but some choices were particularly suspect, especially having the "market_environment" attributes be a dictionary instead of a proper attribute of the class. Could have been accomplished without any loss of generality and with the gain of better data checking at implementation, so it's a bit puzzling why it wasn't.

Overall, still a pretty good read. But note that as of 2024, the fxcmpy package was no longer on PyPI.
Profile Image for Lizi Zhu.
5 reviews19 followers
December 20, 2019
The book is awfully written. I have not read a worse written book on a language. Imagine you write something in English and let google translate it into Hawaiian, and then translate that back into English, and then...back and forth for 100 times. This book has to be written in a way aforementioned. It doesn't feel like it's written by a human. I trust a program can write a better book. Ironically, it's a book about language written a computer scientist. Awful. My suggestion is to ignore the explanations and simply type the code provided in the book. So work through the book by literally typing the code. What you see is what you believe. You will see what he fails to convey in his own words.
8 reviews
April 16, 2016
I love the quant software that comes with this. Its great that they share all of the data and scripts for you to play along while reading through this well written and informative introduction to pythons never ending usefulness in finance.
Displaying 1 - 17 of 17 reviews

Join the discussion

Can't find what you're looking for?

Get help and learn more about the design.