These are 5 books that I highly recommend when starting to learn Python. I’ve read more but in my opinion these are the best, judged on content, clarity and learning. If I could start again these would be the books I read first and in this order, they are:
1. A Whirlwind Tour of Python
2. Python A Crash Course: A Hands-On, Project-Based Introduction to Programming
3. Learn Python the Hard Way: A Very Simple Introduction too the Terrifyingly Beautiful World of Computers and Code
4. Automate the Boring Stuff with Python: Practical Programming for Total Beginners
5. Python for Data Analysis
1. A Whirlwind Tour of Python (Jake VanderPlas, O’Reilly)
This book is perfect for learning the basics of Python. I found it after learning the basics, still it was a very useful read, helping me to help recap and consolidate my learning. It contains all the basic functions of the language. I’d been looking for a book like this, even considered writing my own. Thankfully I found this gem and didn’t need to.
I recommend this book as a quick introduction to Python, read it first before anything else. Alternatively, if you have already learnt some Python then read to quickly prime your knowledge, it’s only a short read.
2.Python A Crash Course: A Hands-On, Project-Based Introduction to Programming (Eric Matthes, No Starch Press)
This book is amazing! It’s easy to read, easy to follow and packed full of code, including some relatively advanced examples. I read it within a couple of months of starting Python. I found it extremely useful as it helped me progress more than any other resource and made me feel like a developer for the first time.
A good basic understanding will help you get more out of the book, since some of the code is advance. I also recommend you annotate your code with detailed comments that will help you in the future – I didn’t! Recognising the need after returning to hack the game code; Trying to figure out what was going on took me a long time.
I recommend this book once you have a basic understanding of Python and want to take it to find out a bit more, taking your knowledge to the next level.
3. Learn Python the Hard Way: A Very Simple Introduction too the Terrifyingly Beautiful World of Computers and Code (Zed A. Shaw, Addison-Wesley)
This book is a great way to learn, unlike other books it’s more focused on exercises than reading, with each new concept explained over 2-3 pages, followed by several short exercises. Making it a slow but fruitful read.
It can be read by people with no exposure to Python, it is after all for learning Python. Equally it could be read to deepen your understanding, grasp and depth of Python. This is where the book has proved useful to me. The author has clearly thought about the flow, composition and exercises, bringing great value. Despite starting the book with a good basic knowledge of Python I am still learning a lot. An added benefit (if you like to look on the bright side) is that it’s written in Python 2, allowing me to appreciate some of the differences between the two versions.
I recommend using this book as a workbook, doing an exercise every day or something similar. You can start the day you start learning Python.
4.Automate the Boring Stuff with Python: Practical Programming for Total Beginners (Al Sweigart, No Starch Press)
Another great book from ‘No Starch Press’. The introduction states it is not written for professional coders, rather it’s ‘for everyone else’ from administrators to academics.
I read this shortly after ‘Python a Crash Course’. I found it great for covering the basics of Python, consolidating my Knowledge and filling in some gaps. It was also a great introduction to slightly more advanced things such as: reading/ writing/ organising files; working with various file formats (PDF, txt, csv, JSON, Word, Excel); timing; web scraping;scripting email responses; image manipulation and finally the automation of mouse clicks and keyboard strokes to make your computer work for you (reminds me of the Simpsons episode where Homer automates his job with a bobbing toy that nearly ends up blowing up the nuclear power station, until he comes to the rescue!). There is a guideline in Python ‘Don’t Repeat Yourself’, ‘DRY’ for short. This book was, implicitly, very useful with respect to this guideline.
As with the crash course book, I recommend this once you have a acquired a simple understanding and want to find out a bit more about the possibilities Python presents.
5. Python for Data Analysis (Wes McKinney, O’Reilly)
Data analysis is one of the major applications of Python and this book is a great introduction to it. I read it after having done a couple of months of data analysis. During which, I spent hours searching for answers on StackOverflow. Reading this beforehand would have saved me a lot of time.
Several libraries have been built for data analysis, the most popular being: numpy, pandas and matplotlib, which are often used in combination.This book is written by the founder of Pandas and covers these three main libraries. Giving the basics in the first few chapters, before moving on to more advanced information.
I recommend this book if you are going to use Python for any data analysis, be that direct or indirectly, as data analysis is not just for sums.
There are a wealth of books out there to help you learn Python, some are free others come at a cost. Finding the best books is a case of trial and error, some are much better designed than others and of course there is personal opinion and preference to consider. The five books above have been my personal favourites, being the easiest to understand while allowing my knowledge to progress in leaps. I hope that you will find them useful too. If there are any other books you have found particularly good then please let me know.
As a final note I have found books published by No Starch Press to be particularity good and I am eagerly awaiting their forthcoming releases. O’Rielly are also a source of some fantastic publications, including more advanced material.