Best Books for Learning Python in 2021
Tags: python, books, beginners
Published: 2020-11-18 23:12:15


## its almost that time of year when people want to learn python

As we get closer to the end of one of the oddest years on record and everyone changes their Google search queries to 'best python books 2021', I thought it might be a good time to tackle the incredibly popular question of "If I want to learn Python, what books should I read?".  There are endless articles on the topic - and basically any article will lead you to [Automate the Boring Stuff](https://automatetheboringstuff.com/) - but I thought it was time to throw my hat in the ring, so to speak.  If you're not a regular reader, I've done this a few times in the past with [newsletters](/blog/best-data-science-newsletters/), [twitter accounts](/blog/best-data-science-twitter-accounts/), and [podcasts](/blog/best-data-science-podcasts/).

Just as a forewarning, in a few past articles I documented all the code I used to get to the results of the post.  This time I'm not doing so, and I'm sorry.  

I mean I'm not really sorry - it takes *a lot more effort* to format my code from a sketchy jupyter notebook to a presentable-ish jupyter notebook.  So we're just looking at results and random commentary from me this time!

Anyways, on to the stuff you care about - the top python books to read this year.  

## top python books to read in 2021

All the data points here are from Goodreads, which is... probably not the best way to get the data if we're being honest, but its the one I had available to me. So... books!  The list below includes both beginner and not-beginner books - I'll go through the list at another time and split those out, but for now I'm just posting this online.


| title | author | average_rating | ratings_count | publish_date | 
|-------|----------|---------|---------|--------------| 
| <a href="https://www.goodreads.com/book/show/22800567-fluent-python" target="_blank">Fluent Python: Clear, Concise, and Effective Programming</a> | Luciano Ramalho | 4.66 | 777 | 2015-01-25 | 
| <a href="https://www.goodreads.com/book/show/22847284-grokking-algorithms-an-illustrated-guide-for-programmers-and-other-curio" target="_blank">Grokking Algorithms An Illustrated Guide For Programmers and Other Curious People</a> | Aditya Y. Bhargava | 4.41 | 1,576 | 2015-01-01 | 
| <a href="https://www.goodreads.com/book/show/33986067-deep-learning-with-python" target="_blank">Deep Learning with Python</a> | Francois Chollet | 4.64 | 680 | 2018-12-04 | 
| <a href="https://www.goodreads.com/book/show/32899495-hands-on-machine-learning-with-scikit-learn-and-tensorflow" target="_blank">Hands-On Machine Learning with Scikit-Learn and TensorFlow</a> | Aurélien Géron | 4.55 | 651 | 2017-04-09 | 
| <a href="https://www.goodreads.com/book/show/22514127-automate-the-boring-stuff-with-python" target="_blank">Automate the Boring Stuff with Python: Practical Programming for Total Beginners</a> | Al Sweigart | 4.28 | 1,432 | 2014-11-25 | 
| <a href="https://www.goodreads.com/book/show/23241059-python-crash-course" target="_blank">Python Crash Course: A Hands-On, Project-Based Introduction to Programming</a> | Eric Matthes | 4.35 | 976 | 2015-02-25 | 
| <a href="https://www.goodreads.com/book/show/14744694-python-for-data-analysis" target="_blank">Python for Data Analysis</a> | Wes McKinney | 4.13 | 1,226 | 2011-12-30 | 
| <a href="https://www.goodreads.com/book/show/80435.Learning_Python" target="_blank">Learning Python</a> | Mark Lutz | 3.96 | 1,976 | 2013-07-24 | 
| <a href="https://www.goodreads.com/book/show/23020812-effective-python" target="_blank">Effective Python: 59 Specific Ways to Write Better Python</a> | Brett Slatkin | 4.29 | 630 | 2015-02-01 | 
| <a href="https://www.goodreads.com/book/show/25545994-python-machine-learning" target="_blank">Python Machine Learning</a> | Sebastian Raschka | 4.27 | 411 | 2015-09-23 | 
| <a href="https://www.goodreads.com/book/show/80436.Programming_Python" target="_blank">Programming Python</a> | Mark Lutz | 3.98 | 848 | 1996-08-01 | 
| <a href="https://www.goodreads.com/book/show/26457146-python-data-science-handbook" target="_blank">Python Data Science Handbook: Tools and Techniques for Developers</a> | Jake Vanderplas | 4.32 | 285 | 2016-03-25 | 
| <a href="https://www.goodreads.com/book/show/24346909-introduction-to-machine-learning-with-python" target="_blank">Introduction to Machine Learning with Python: A Guide for Data Scientists</a> | Andreas C. Müller | 4.34 | 257 | 2015-06-25 | 
| <a href="https://www.goodreads.com/book/show/31134574-python-for-everybody" target="_blank">Python for Everybody: Exploring Data in Python 3</a> | Charles Severance | 4.31 | 256 | 2016-07-10 | 
| <a href="https://www.goodreads.com/book/show/17152735-python-cookbook" target="_blank">Python Cookbook</a> | David Beazley | 4.16 | 374 | 2002-07-15 | 
| <a href="https://www.goodreads.com/book/show/8341335-learn-python-the-hard-way" target="_blank">Learn Python The Hard Way</a> | Zed A. Shaw | 3.87 | 881 | 2010-01-01 | 
| <a href="https://www.goodreads.com/book/show/18774655-flask-web-development" target="_blank">Flask Web Development: Developing Web Applications with Python</a> | Miguel Grinberg | 4.19 | 302 | 2014-04-28 | 
| <a href="https://www.goodreads.com/book/show/25407018-data-science-from-scratch" target="_blank">Data Science from Scratch: First Principles with Python</a> | Joel Grus | 3.93 | 552 | 2015-04-14 | 
| <a href="https://www.goodreads.com/book/show/17912811-test-driven-web-development-with-python" target="_blank">Test-Driven Web Development with Python</a> | Harry Percival | 4.21 | 237 | 2010-01-01 | 
| <a href="https://www.goodreads.com/book/show/22299369-black-hat-python" target="_blank">Black Hat Python: Python Programming for Hackers and Pentesters</a> | Justin Seitz | 4.04 | 319 | 2014-11-25 | 
| <a href="https://www.goodreads.com/book/show/583495.Python_Pocket_Reference" target="_blank">Python Pocket Reference</a> | Mark Lutz | 4.00 | 307 | 1998-03-15 | 
| <a href="https://www.goodreads.com/book/show/17912929-introducing-python" target="_blank">Introducing Python: Modern Computing in Simple Packages</a> | Bill Lubanovic | 4.21 | 170 | 2013-11-22 | 
| <a href="https://www.goodreads.com/book/show/34695800-a-common-sense-guide-to-data-structures-and-algorithms" target="_blank">A Common-Sense Guide to Data Structures and Algorithms: Level Up Your Core Programming Skills</a> | Jay Wengrow | 4.22 | 160 | 2017-08-22 | 
| <a href="https://www.goodreads.com/book/show/8933914-head-first-python" target="_blank">Head First Python</a> | Paul Barry | 3.83 | 320 | 2010-01-01 | 
| <a href="https://www.goodreads.com/book/show/34695799-python-testing-with-pytest" target="_blank">Python Testing with Pytest: Simple, Rapid, Effective, and Scalable</a> | Brian Okken | 4.06 | 119 | 2017-10-25 | 
| <a href="https://www.goodreads.com/book/show/12042357-think-stats" target="_blank">Think Stats</a> | Allen B. Downey | 3.63 | 315 | 2011-01-01 | 
| <a href="https://www.goodreads.com/book/show/51941365-the-self-taught-programmer" target="_blank">The Self-Taught Programmer: The Definitive Guide to Programming Professionally</a> | Cory Althoff | 4.00 | 71 | 2017-01-24 | 
| <a href="https://www.goodreads.com/book/show/43174990-serious-python" target="_blank">Serious Python: Black-Belt Advice on Deployment, Scalability, Testing, and More</a> | Julien Danjou | 4.03 | 64 | 2018-12-01 | 
| <a href="https://www.goodreads.com/book/show/31393737-feature-engineering-for-machine-learning" target="_blank">Feature Engineering for Machine Learning</a> | Alice Zheng | 3.81 | 80 | 2018-04-10 | 
| <a href="https://www.goodreads.com/book/show/40573304-impractical-python-projects" target="_blank">Impractical Python Projects: Playful Programming Activities to Make You Smarter</a> | Lee Vaughan | 4.24 | 31 | 2018-11-27 | 
| <a href="https://www.goodreads.com/book/show/39339569-python-flash-cards" target="_blank">Python Flash Cards: Syntax, Concepts, and Examples</a> | Eric Matthes | 4.08 | 12 | 2019-01-15 | 
| <a href="https://www.goodreads.com/book/show/49828191-high-performance-python" target="_blank">High Performance Python: Practical Performant Programming for Humans</a> | Micha Gorelick | 4.17 | 7 | 2013-10-22 | 


And what's with the weird sorting, you ask? Well its a combination of average rating & ratings count that I made up for [another project](https://nextnovelproject.com/blog/calculations) that I like a lot.


## So which one should I read if I'm a beginner?

So if we filter down the list above which books are primarily for beginners, you end up with a solid starting point:

- <a href="https://www.goodreads.com/book/show/22514127-automate-the-boring-stuff-with-python" target="_blank">Automate the Boring Stuff with Python: Practical Programming for Total Beginners</a> by Al Sweigart (4.28 avg, 1,432 ratings)
- <a href="https://www.goodreads.com/book/show/23241059-python-crash-course" target="_blank">Python Crash Course: A Hands-On, Project-Based Introduction to Programming</a> by Eric Matthes (4.35 avg, 976 ratings)
- <a href="https://www.goodreads.com/book/show/80435.Learning_Python" target="_blank">Learning Python</a> by Mark Lutz (3.96 avg, 1,976 ratings)
- <a href="https://www.goodreads.com/book/show/22847284-grokking-algorithms-an-illustrated-guide-for-programmers-and-other-curio" target="_blank">Grokking Algorithms An Illustrated Guide For Programmers and Other Curious People</a> by Aditya Y. Bhargava (4.41 avg, 1,576 ratings)
- <a href="https://www.goodreads.com/book/show/14744694-python-for-data-analysis" target="_blank">Python for Data Analysis</a> by Wes McKinney (4.13 avg, 1,226 ratings)

And those are only the top five books on there.  Grokking Algorithms is a bit more focused on the *computer science* aspects of coding rather than the python language, but it does use Python for its examples.  And Python for Data Analysis is basically focused on a python package called *pandas*, which is what any data scientist/analyst spends most of their day in. So if you're truly a beginner, focus on Automate the Boring Stuff, Python Crash Course, and Learning Python.

My other recommendation for beginners is to keep an eye out  for bundle deals, like [humble bundle](https://www.humblebundle.com/level-up-your-python). You can normally get ~10 ebooks for $15. Which is a pretty good deal, given a lot of these books go for $30+ on their own...