Background
One of the first Python and finance books I ever read was Algorithmic Short Selling with Python.
Hands down, it’s one of the best books I’ve ever read that blended Python with finance — teaching both the programming and financial concepts in a clear and practical way.
I continue to come back to this book over time and recently noticed that some of the included Jupyter notebooks had stopped working due to changes in Yahoo Finance APIs and general Python + library updates.
That inspired me to modernize the repository so that current readers (and anyone learning quant finance) can run the examples again without friction.
Modernization Work
The original codebase relied on older versions of pandas, yfinance, and scikit-learn.
I updated and validated all notebooks (Chapters 4–13 + Appendix) to run cleanly on:
- Python 3.11
- pandas 2.2
- yfinance 0.2.40
- scikit-learn 1.5
Key improvements included:
- Replacing deprecated methods (
.ix,.append,.fillna(method=...)) - Updating
yfinance.download()calls for modern usage - Adjusting scikit-learn imports and function signatures
- Ensuring all analyses and visualizations executed successfully
Modernization Approach
Every notebook required at least one cell update due to library changes, API deprecations, or syntax updates.
That said, roughly 90% of the original codebase and structure was preserved.
The goal was not to rewrite or reinterpret the author’s work, but to make minimal, compatibility-focused updates so that all downstream cells continue to function as intended.
This ensures that the financial logic and educational value of the book remain fully intact — only the technical plumbing has been modernized.
Results
Every notebook now runs end-to-end with all outputs preserved for transparency.
The modernized version is publicly available here:
My Updated GitHub Repo
I also submitted a pull request to Packt Publishing so these updates can benefit future readers:
PR #6 — Modernization on PacktPublishing
Why This Matters
Maintaining open-source code is part of keeping knowledge alive.
This project was a great hands-on exercise in:
- Working with legacy data pipelines
- Debugging deprecated syntax
- Validating quantitative workflows end-to-end
- Preserving reproducibility for educational finance content
It also highlights how quickly ecosystems evolve — especially in finance, where a single library update can break an entire backtest or analysis workflow.
Future Plans
My future plans are to incorporate this book’s concepts and examples into the screeners and automation tools I use for live trading.
The goal is to bridge what’s taught in the book with the custom trading frameworks and option analytics I’ve been developing — creating a seamless workflow from learning to real-world execution.
Conclusion
Modernizing Algorithmic Short Selling with Python was both nostalgic and rewarding.
It’s a small way of giving back to a resource that helped shape how I think about algorithmic trading and systematic research.
I highly recommend the book to anyone looking to connect practical finance with Python-based automation.