Python for biologists books


Why learn programming?

Maybe you see colleagues writing programs to save time and deal with large datasets.

Maybe your supervisor has told you that you need to learn programming for your next project.

Maybe you’ve been looking at job ads and noticed just how many of them are asking for programming skills.

Whatever your motivation, learning to program is one of the best investments that you can make for your research and your career.

“Great, great book. I think this is the perfect book for any biologist to who wants to start learning to code with Python. Right away the author has you writing programs that are actually useful for biologists… I didn’t know a command-line from a hole in the ground when I first opened up this book, and mere days later I was impressing my colleagues with my own DNA analysis programs.” review

Buy books now

No matter where you are in your biology career, you already know that programming is rapidly becoming a must-have skill. When you work with data everyday, the ability to write your own tools, to deal with increasingly large datasets, and to automate everyday tasks is game-changing. In a career where there are a seemingly infinite number of demands on your time, learning to program is the single biggest productivity boost you can give yourself.

Most programming books are terrible…

… for people who aren’t already trained in computer science. Chances are you’ve already looked at some online programming tutorials, or browsed some Python books – if so, then you’ll know that they’re simply not designed for people like you. The examples and exercises you’ll find in the vast majority of learn-to-program books have nothing to do with the problems you are interested in solving, because they’re written for people with a completely different background.

“I’ve tried a few Python books, and this is by far the best for me. It jumps straight into the things biologists generally need Python for – creating and manipulating sequence files for example. For all other guides I’ve tried, I’ve had to wade through chapters of less relevant material before I get to anything this useful. I would definitely recommend this to any biologist.” review

Python for biologists is different

Python for Biologists came out of my ten years of experience teaching programming to people with a biological background. I’ve taught everyone from undergraduates to PI’s, and have designed the books for people just like you. You need a programming book

  • with examples and exercises that involve biologically-relevant problems
  • that teaches you to start writing useful code straight away
  • that concentrates on the most useful bits of the language
  • and that doesn’t assume you have a background in computing

As part of my job, I had to teach programming to a group of PhD students in that lab … I chose to go with the textbook, ‘How to think like a Computer Scientist: Think Python’, for my python classes, but, shortly after a week the students, coming from a background of pure biology were not satisfied with the book. They wanted something domain specific. That is when I found your book, and the rest is history … we are finished with Python for Biologists, and as I have earlier mentioned, and couldn’t put it better in any other words, P4B is one awesome book. I cannot thank you enough. -Sai Kishore, Birla Institute of Technology and Science

What You’ll Learn

Python for biologists is a complete programming course for beginners that will give you the skills you need to tackle common biological and bioinformatics problems.

  • Learn how to use Python’s powerful text-manipulation tools to deal with DNA and protein sequence data files
  • Investigate the output that you get from the analysis tools you already use every day
  • Stop running analyses and visualizations manually. Automate common housekeeping jobs and reclaim your time to work on your research

Overview of Python for Biologists

Designed for complete beginners, this book teaches you programming from scratch using real-life biological examples. You’ll use structured exercises to practise your programming skills while explanations and solutions point out the tricks and pitfalls that are most important for biological work. By the end of this book, you’ll have all the skills you need to start writing your own analysis programs, deal with large datasets, and automate common tasks.

Chapters include: Introducing Python, Manipulating text, Reading and writing files, List and loops, Writing functions, Conditional tests, Regular expressions, Working with dicts

Overview of Advanced Python for Biologists

Take the next step in your programming and learn how Python’s advanced features can let you write code faster and more efficiently. This book introduces you to new approaches to programming and teaches you techniques that are necessary for building larger programs. By the end of this book, you’ll be able to use and understand functional and object-oriented programming and to write larger, faster and more efficient programs.

Chapters include: Recursion and trees, Complex data structures, Object-oriented Python, Functional Python, Comprehensions, Exceptions

Click here to buy Python for Biologists or Advanced Python for Biologists

About The Author

Hi, I’m Martin.

I’m a biologist by training who learned to write code during my PhD and started teaching others to do the same shortly after. I use Python every day in my own research and regularly teach programming courses to biologists and bioinformaticians. A few years ago I realized that, while there were many great Python books out there, there was nothing specifically designed for the background and day-to-day programming needs of biological researchers, so I decided to write one (and ended up writing two).

I’m currently Lecturer in Bioinformatics at Edinburgh University. If you’re in the area and want to chat about programming, drop me an email:

Frequently Asked Questions

I’m completely new to programming, are these books for me?

As long as you start with Python for Biologists and not the advanced book, you’ll be fine. If you can edit a text file and run an existing program, then you are ready to learn how to code. If you’re thinking about starting with the Advanced book, you’ll need to know about variables, lists and loops, about writing functions, reading files and using dicts.

What if it turns out that I hate programming/Python/the books/you?

If for any reason you don’t like the books, you can get a no-questions-asked refund. Just hit reply to your email reciept within 30 days and let me know.

What version of Python do I need?

All of the material in the books will work on both Python 2 and Python 3. Whenever there are differences, it’s mentioned and explained in the text.

Can I buy a bunch of copies for my lab/study group/institute/university/business?

Sure thing, if you want to share the books with your colleagues then I can sell you a group license at a discount on the individual rate – just drop me an email to and we’ll talk.

Powered by WordPress. Designed by Woo Themes