DEV Community

Cover image for The 25 most recommended Python books of all-time.
Pierre
Pierre

Posted on • Edited on • Originally published at best-books.dev

The 25 most recommended Python books of all-time.

This article is a follow up of the one I did about the the most recommended programming books of all-time.

If you've read this one recently. I guess you can jump straight to the results.

There are countless lists on the internet claiming to be the list of must-read python books and it seemed that all those lists always recommended that same books minus two or three odd choices.

Finding good resources for learning programming is always tricky. Every-one has its own opinion about what book is the best to learn, and as we say in french, "Color and tastes should not be argued about".

However I thought it would be interesting to trust the wisdom of the crown and to find the books that appeared the most in those "Best Python Book" lists.

If you want to jump right on the results go take a look below at the full results. If you want to learn about the methodology, bear with me.

Disclaimer: I spent countless hours on this article so I've decided to put Amazon affiliation links to see if those kinds of detailed articles could be a viable source of revenue, ... or not 🤷‍♂️.

Methodology:

I've simply asked Google for a few queries like "Best Python Books" and its variations of. I have then scrapped all those pages (using ScrapingBee, a web scraping API I'm working on).

I've deduplicated the links and ended up with nearly 170 links. Using the title of the pages I was also able to quickly discards:

  • list focused on one particular technology or platform
  • list focused on one particular year
  • list focused on free books
  • Quora and Reddit threads

I ended up with almost 130 HTML files. I went on opening all the files on my browser, open my chrome inspector, found and wrote the CSS selector matching book titles in the article. This took me around 1hours, almost 30 seconds per page.

This also allowed me to discard even more nonrelevant pages, and I discarded a lot. In the end I compiled around 70 lists into this one.

Book titles were then extracted with manuel extraction and some web scraping.

I ended up with a huge list of books, not usable without some post-processing.

To find the most quoted python books I needed to normalize my results.

I had to play with all the different variation like "{title} by {author}" or "{title} - {author}".

Or "{title}:{subtitle}" and "{title}", or even all the one containing edition number.

I ended up doing it using this simple custom Python function:

def clean_link(link):
    link = link.encode().decode('ascii', errors='ignore')
    link = link.replace("'", '')
    link = link.lower()
    link = ' '.join([w for w in link.split(' ') if w not in ['the', 'a']])
    link = link.split('by')[0]
    link = link.split(':')[0]
    link = link.split('(')[0]
    link = ' '.join(link.split())
    link = link.replace('-', '_')
    link = ''.join([c for c in link if c.isalpha() or c == '_' or c == ' '])
    link = link.strip()
    link = link.replace(' ', '_')
    link = ''.join([c for c in link if c.isalpha() or c == '_'])
    return link
Enter fullscreen mode Exit fullscreen mode

and quite a bit of manual cleaning.

My list now looked like this:

From there it was easy to compute the most recommended books. You can find all the data used to process this list on this repo. Now let's take a look at the list:

25 most recommended Python books of all-time

25. Python: Learn Python in One Day and Learn It Well by Jamie Chan (7.9% recommended)

"Have you always wanted to learn computer programming but are afraid it'll be too difficult for you? Or perhaps you know other programming languages but are interested in learning the Python language fast?

This book is for you. You no longer have to waste your time and money learning Python from lengthy books, expensive online courses or complicated Python tutorials." Amazon.com

24. Deep Learning with Python by François Chollet (7.9% recommended)

"This book was written for anyone who wishes to explore deep learning from scratch or broaden their understanding of deep learning. Whether you’re a practicing machine-learning engineer, a software developer, or a college student, you’ll find value in these pages. This book offers a practical, hands-on exploration of deep learning. It avoids mathematical notation, preferring instead to explain quantitative concepts via code snippets and to build practical intuition about the core ideas of machine learning and deep learning.

You’ll learn from more than 30 code examples that include detailed commentary, practical recommendations, and simple high-level explanations of everything you need to know to start using deep learning to solve concrete problems. The code examples use the Python deep-learning framework Keras, with Tensor- Flow as a back-end engine. Keras, one of the most popular and fastest-growing deeplearning frameworks, is widely recommended as the best tool to get started with deep learning." Amazon.com

23. Python Data Science Handbook by Jake VanderPlas (7.9% recommended)

"For many researchers, Python is a first-class tool mainly because of its libraries for storing, manipulating, and gaining insight from data. Several resources exist for individual pieces of this data science stack, but only with the Python Data Science Handbook do you get them all—IPython, NumPy, Pandas, Matplotlib, Scikit-Learn, and other related tools.

Working scientists and data crunchers familiar with reading and writing Python code will find this comprehensive desk reference ideal for tackling day-to-day issues: manipulating, transforming, and cleaning data; visualizing different types of data; and using data to build statistical or machine learning models. Quite simply, this is the must-have reference for scientific computing in Python." Amazon.com

22. Violent Python by TJ O'Connor (8.8% recommended)

"Violent Python shows you how to move from a theoretical understanding of offensive computing concepts to a practical implementation. Instead of relying on another attacker’s tools, this book will teach you to forge your own weapons using the Python programming language. This book demonstrates how to write Python scripts to automate large-scale network attacks, extract metadata, and investigate forensic artifacts.

It also shows how to write code to intercept and analyze network traffic using Python, craft and spoof wireless frames to attack wireless and Bluetooth devices, and how to data-mine popular social media websites and evade modern anti-virus." Amazon.com

21. Natural Language Processing with Python by Steven Bird & Ewan Klein & Edward Loper (9.6% recommended)

"This book offers a highly accessible introduction to natural language processing, the field that supports a variety of language technologies, from predictive text and email filtering to automatic summarization and translation. With it, you'll learn how to write Python programs that work with large collections of unstructured text. You'll access richly annotated datasets using a comprehensive range of linguistic data structures, and you'll understand the main algorithms for analyzing the content and structure of written communication.

Packed with examples and exercises, Natural Language Processing with Python will help you: Extract information from unstructured text, either to guess the topic or identify 'named entities' Analyze linguistic structure in text, including parsing and semantic analysis Access popular linguistic databases, including WordNet and treebanks Integrate techniques drawn from fields as diverse as linguistics and artificial intelligence This book will help you gain practical skills in natural language processing using the Python programming language and the Natural Language Toolkit (Nltk) open source library.

If you're interested in developing web applications, analyzing multilingual news sources, or documenting endangered languages - or if you're simply curious to have a programmer's perspective on how human language works - you'll find Natural Language Processing with Python both fascinating and immensely useful." Amazon.com

20. The Hitchhiker's Guide to Python by Kenneth Reitz & Tanya Schlusser (9.6% recommended)

"The Hitchhiker's Guide to Python takes the journeyman Pythonista to true expertise. More than any other language, Python was created with the philosophy of simplicity and parsimony. Now 25 years old, Python has become the primary or secondary language (after SQL) for many business users. With popularity comes diversity—and possibly dilution.

This guide, collaboratively written by over a hundred members of the Python community, describes best practices currently used by package and application developers. Unlike other books for this audience, The Hitchhiker’s Guide is light on reusable code and heavier on design philosophy, directing the reader to excellent sources that already exist." Amazon.com

19. Python Pocket Reference by Mark Lutz (10.5% recommended)

"This convenient pocket guide is the perfect on-the-job quick reference. You’ll find concise, need-to-know information on Python types and statements, special method names, built-in functions and exceptions, commonly used standard library modules, and other prominent Python tools. The handy index lets you pinpoint exactly what you need.

Written by Mark Lutz—widely recognized as the world’s leading Python trainer—Python Pocket Reference is an ideal companion to O’Reilly’s classic Python tutorials, Learning Python and Programming Python, also written by Mark." Amazon.com

18. Invent Your Own Computer Games with Python by Al Sweigart (10.5% recommended)

"Begin by building classic games like Hangman, Guess the Number, and Tic-Tac-Toe, and then work your way up to more advanced games, like a text-based treasure hunting game and an animated collision-dodging game with sound effects. Along the way, you’ll learn key programming and math concepts that will help you take your game programming to the next level." Amazon.com

17. Python in a Nutshell by Alex Martelli & Anna Ravenscroft & Steve Holden (11.4% recommended)


"Useful in many roles, from design and prototyping to testing, deployment, and maintenance, Python is consistently ranked among today’s most popular programming languages. The third edition of this practical book provides a quick reference to the language—including Python 3.5, 2.7, and highlights of 3.6—commonly used areas of its vast standard library, and some of the most useful third-party modules and packages.

Ideal for programmers with some Python experience, and those coming to Python from other programming languages, this book covers a wide range of application areas, including web and network programming, XML handling, database interactions, and high-speed numeric computing. Discover how Python provides a unique mix of elegance, simplicity, practicality, and sheer power." Amazon.com

16. Introduction to Machine Learning with Python by Andreas C. MĂźller & Sarah Guido (12.3% recommended)


"Machine learning has become an integral part of many commercial applications and research projects, but this field is not exclusive to large companies with extensive research teams. If you use Python, even as a beginner, this book will teach you practical ways to build your own machine learning solutions. With all the data available today, machine learning applications are limited only by your imagination.

You’ll learn the steps necessary to create a successful machine-learning application with Python and the scikit-learn library. Authors Andreas Müller and Sarah Guido focus on the practical aspects of using machine learning algorithms, rather than the math behind them. Familiarity with the NumPy and matplotlib libraries will help you get even more from this book." Amazon.com

15. Programming Python by Mark Lutz (12.3% recommended)

"If you've mastered Python's fundamentals, you're ready to start using it to get real work done. Programming Python will show you how, with in depth tutorials on the language's primary application domains: system administration, GUIs, and the Web. You'll also explore how Python is used in databases, networking, front end scripting layers, text processing, and more. This book focuses on commonly used tools and libraries to give you a comprehensive understanding of Python’s many roles in practical, real world programming.

You'll learn language syntax and programming techniques in a clear and concise manner, with lots of examples that illustrate both correct usage and common idioms. Completely updated for version 3.x, Programming Python also delves into the language as a software development tool, with many code examples scaled specifically for that purpose." Amazon.com

14. David Beazley by Python Essential Reference (14.0% recommended)

"Python Essential Reference is the definitive reference guide to the Python programming language — the one authoritative handbook that reliably untangles and explains both the core Python language and the most essential parts of the Python library.

Designed for the professional programmer, the book is concise, to the point, and highly accessible. It also includes detailed information on the Python library and many advanced subjects that is not available in either the official Python documentation or any other single reference source.

Thoroughly updated to reflect the significant new programming language features and library modules that have been introduced in Python 2.6 and Python 3, the fourth edition of Python Essential Reference is the definitive guide for programmers who need to modernize existing Python code or who are planning an eventual migration to Python 3. Programmers starting a new Python project will find detailed coverage of contemporary Python programming idioms." Amazon.com

13. Dive into Python 3 by Mark Pilgrim (14.0% recommended)

"There are a huge number of python developers who will need to learn to port their code to python 3, and Dive Into Python 3 is the ideal hands-on introduction to the latest version of python for them. Its unique style of giving a chunk of code first and then picking it apart is ideally suited to existing developers who want to understand the new version of the language quickly." Amazon.com

12. Python Machine Learning by Sebastian Raschka & Vahid Mirjalili (14.9% recommended)


"is a comprehensive guide to machine learning and deep learning with Python. It acts as both a step-by-step tutorial, and a reference you'll keep coming back to as you build your machine learning systems.

Packed with clear explanations, visualizations, and working examples, the book covers all the essential machine learning techniques in depth. While some books teach you only to follow instructions, with this machine learning book, Raschka and Mirjalili teach the principles behind machine learning, allowing you to build models and applications for yourself." Amazon.com

11. Python Tricks by Dan Bader (14.9% recommended)

"With Python Tricks: The Book you’ll discover Python’s best practices and the power of beautiful & Pythonic code with simple examples and a step-by-step narrative.

You'll get one step closer to mastering Python, so you can write beautiful and idiomatic code that comes to you naturally.

Learning the ins and outs of Python is difficult—and with this book you'll be able to focus on the practical skills that really matter. Discover the “hidden gold” in Python’s standard library and start writing clean and Pythonic code today." Amazon.com

10. Think Python: How to Think Like a Computer Scientist by Allen B. Downey (19.3% recommended)

"If you want to learn how to program, working with Python is an excellent way to start. This hands-on guide takes you through the language a step at a time, beginning with basic programming concepts before moving on to functions, recursion, data structures, and object-oriented design. This second edition and its supporting code have been updated for Python 3.

Through exercises in each chapter, you’ll try out programming concepts as you learn them. Think Python is ideal for students at the high school or college level, as well as self-learners, home-schooled students, and professionals who need to learn programming basics. Beginners just getting their feet wet will learn how to start with Python in a browser." Amazon.com

9. Effective Python by Brett Slatkin (19.3% recommended)


"It’s easy to start developing programs with Python, which is why the language is so popular. However, Python’s unique strengths, charms, and expressiveness can be hard to grasp, and there are hidden pitfalls that can easily trip you up." Amazon.com

8. Python for Data Analysis by Wes McKinney (20.2% recommended)

"This book is concerned with the nuts and bolts of manipulating, processing, cleaning, and crunching data in Python. My goal is to offer a guide to the parts of the Python programming language and its data-oriented library ecosystem and tools that will equip you to become an effective data analyst. While 'data analysis' is in the title of the book, the focus is specifically on Python programming, libraries, and tools as opposed to data analysis methodology. This is the Python programming you need for data analysis." Amazon.com

7. Learn Python the Hard Way by Zed Shaw (21.1% recommended)

"Zed Shaw has perfected the world’s best system for learning Python 3. Follow it and you will succeed—just like the millions of beginners Zed has taught to date! You bring the discipline, commitment, and persistence; the author supplies everything else." Amazon.com

6. Automate the Boring Stuff with Python by Al Sweigart (23.7% recommended)

"If you've ever spent hours renaming files or updating hundreds of spreadsheet cells, you know how tedious tasks like these can be. But what if you could have your computer do them for you?

In this fully revised second edition of the best-selling classic Automate the Boring Stuff with Python, you'll learn how to use Python to write programs that do in minutes what would take you hours to do by hand--no prior programming experience required. You'll learn the basics Python and explore Python's rich library of modules for performing specific tasks, like scraping data off websites, reading PDF and Word documents, and automating clicking and typing tasks." Amazon.com

5. Head First Python: A Brain-Friendly Guide by Paul Barry (25.4% recommended)


"Want to learn the Python language without slogging your way through how to manuals? With Head First Python, you’ll quickly grasp Python’s fundamentals, working with the built in data structures and functions. Then you’ll move on to building your very own webapp, exploring database management, exception handling, and data wrangling. If you’re intrigued by what you can do with context managers, decorators, comprehensions, and generators, it’s all here. This second edition is a complete learning experience that will help you become a bonafide Python programmer in no time." Amazon.com

4. Python Crash Course by Eric Matthes (33.3% recommended)

"is a straightforward introduction to the core of Python programming. Author Eric Matthes dispenses with the sort of tedious, unnecessary information that can get in the way of learning how to program, choosing instead to provide a foundation in general programming concepts, Python fundamentals, and problem solving. Three real world projects in the second part of the book allow readers to apply their knowledge in useful ways.

Readers will learn how to create a simple video game, use data visualization techniques to make graphs and charts, and build and deploy an interactive web application. Python Crash Course, 2nd Edition teaches beginners the essentials of Python quickly so that they can build practical programs and develop powerful programming techniques." Amazon.com

3. Fluent Python by Luciano Ramalho (35.1% recommended)

"Python’s simplicity lets you become productive quickly, but this often means you aren’t using everything it has to offer. With this hands-on guide, you’ll learn how to write effective, idiomatic Python code by leveraging its best—and possibly most neglected—features. Author Luciano Ramalho takes you through Python’s core language features and libraries, and shows you how to make your code shorter, faster, and more readable at the same time.

Many experienced programmers try to bend Python to fit patterns they learned from other languages, and never discover Python features outside of their experience. With this book, those Python programmers will thoroughly learn how to become proficient in Python 3." Amazon.com

2. Python Cookbook by David Beazley & Brian K. Jones (36.0% recommended)

"If you need help writing programs in Python 3, or want to update older Python 2 code, this book is just the ticket. Packed with practical recipes written and tested with Python 3.3, this unique cookbook is for experienced Python programmers who want to focus on modern tools and idioms.

Inside, you’ll find complete recipes for more than a dozen topics, covering the core Python language as well as tasks common to a wide variety of application domains. Each recipe contains code samples you can use in your projects right away, along with a discussion about how and why the solution works." Amazon.com

1. Learning Python by Mark Lutz (36.0% recommended)

Conclusion

Although the order might suprise some, by definition, most of you must have heard of these books already.

A few additional things I learned making this list:

  • O'Reilly is the big winner of this list with 12 books in the top 25
  • I'm happy to see one of my favorite editor, No Starch Press with 4 books in the list
  • Mark Lutz it the author of 3 books

I hope you enjoyed this article.

I must admit, this one took a while to write. If you liked this article and feel like Twitter would like it please do not hesitate to love and retweet, it really does help :).

(do NOT create an account just for this though)

Do not hesitate to follow me if you don't want to miss my next posts. I write about tech, my bootstrapping journey and I occasionnaly write more data analysis article like this one.

Top comments (0)