top of page

Reviewing: Python for Finance Cookbook

While the book covers a large range of topics, I do not recommend it, at least not in 2025.

Cover of "Python for Finance Cookbook, Second Edition" by Eryk Lewinson. Features orange wave pattern, <packt> logo, and author's photo.

I would just like to that Python for Finance does a good job of going over a broad range of topics. There are a lot of methods and for someone fairly new, this is probably fine. I do have some problems though.


The first is that being a one stop shop has likely impacted the depth of the material. For example, it doesn't really reach into any of the math on machine learning, which is disappointing but also impacts the ability to understand methods such as XGBoost. Additionally, the explanations for the code are more like explanations for the methods, which I also feel leave much to be desired in some areas, and explain things too broadly to really help understand the models.


The second is probably due to the book being a little too old now. Python packages get updated all the time and there is just a lot of troubleshooting that needs to be done to go through some of the examples now. For example, df.[: , "Adj Close"] is used all the time for dataframes where "Adj Close" isn't a column (minor problem--> switch "Adj Close" to "Close" after df.head()). However, I could not get the dataset in the later chapters on machine learning to load, so to run those examples you need a new dataset, which is a larger issue.


Also, I'm pretty sure the book was made for Linux (uses !wget, when Windows uses !curl), which is just something readers need to keep in mind.


I would probably recommend Python for Data Analysis (Wes McKinney) as an alternative. The problem is that it doesn't really go over machine learning methods, so you would have to find another resource on machine learning in Python to cover that portion.

If you found this helpful or enjoyable, please consider subscribing to our newsletter for more.  


You can reach out to us here for consulting services.

Comments


bottom of page