10 Jan

Book review: NumPy 1.5 Beginner’s guide

Packt publishing sent me a copy of NumPy 1.5 Beginner’s guide by Ivan Idris.

The book actually covers more than only numpy: it is a full introduction to numerical computing with Python. The table of contents is the following:

  • NumPy Quick Start
  • Beginning with NumPy Fundamentals
  • Get into Terms with Commonly Used Functions
  • Convenience Functions for Your Convenience
  • Working with Matrices and ufuncs
  • Move Further with NumPy Modules
  • Peeking Into Special Routines
  • Assure Quality with Testing
  • Plotting with Matplotlib
  • When NumPy is Not Enough: SciPy and Beyond

The book is easy to read, as it requires no specific expertise other than knowing basic Python programming. It is full of examples and exercises, which is really great for learning. I find the style of the author, Ivan Idris, particularly amusing and relaxing, engaging the reader with questions, challenges, or even jokes (“Have a go hero”).

With regards to the formatting and the print, the book is written in large fonts, with sectioning information, tips and exercises clearly standing out.

It is full of practical information, such as how to install the software, or where to get help. Finally, One thing that I appreciated, is that the examples are typed in IPython. Each time I teach, I like to use IPython, because it is full of features to help plotting, debugging and profiling numerical code. The book even has a little introduction to some useful IPython features.

After an introduction to the work flow, the book explores array manipulation such as creation or reshaping, followed by some simple numerics and the battery of array-based operations on functions and polynomials. Then it presents linear algebra and signal processing basics (FFT). It also covers the financial functions that are present in numpy and mentions testing, which is very important to achieve quality code. The book finishes with matplotlib and scipy, two modules that are important to know to go further.

The examples are mostly drawn from statistics or financial applications, such as computing running averages on stock quotes. Basic math explanations, such as the definition of the Moore-Penrose pseudo-inverse, are given when needed.

To conclude, I enjoyed this book and I think that it is a nice addition to my library. It answers exactly it’s title: it is well-suited for beginners wanting to learn numpy. On the other hand, I would not recommend it as a reference material, or as a book to learn more general scientific or numerical computing with Python.

7 Responses to “Book review: NumPy 1.5 Beginner’s guide”

  1. Tshepang Lekhonkhobe Says:

    grammar problems: “It is fully…” and “touches a bit testing..”

    feel free to delete this comment when done

  2. gael Says:

    Thanks for correct my mistakes. I really cannot write anything without typos.

  3. Mike Says:

    Just an FYI: The “Have a Go Hero” section is in a LOT of Packt books.

  4. gael Says:

    I guessed so, but I still found it outrageously funny.

  5. Daniel Says:

    If you don’t recommend this text as one “to learn more general scientific or numerical computing with Python”, do you have one you do recommend?

  6. gael Says:

    I would recommend our own “Scipy lecture notes”: http://scipy-lectures.github.com/ . They are not as polished as they are done by volunteers and were never copy-edited by a professional, but they are free, and we’ll gladly accept any improvements.

    If you are looking for an actual book, there is “Python scripting for computational science” by Hans Petter Langtangen. It is a bit expensive as it is a Springer’s book (actually it is outrageously expensive if you buy it new), but you’ll get the polish that comes from Springer.

    As a side note, we _are_ looking for people to help us with the copy editing and phrasing of the scipy lecture notes. People who pitch in with significant work will get their names in the list of contributors/authors.

  7. NumPy Project Euler Problem 2 Says:

    [...] check out NumPy Beginner’s Guide by yours truly. I would like to thank Christopher Felton and Gael Varoquaux for their recent reviews of my [...]

Leave a Reply