Review: Beginning Python Visualization

Posted to Reviews, Software

Python is a powerful programming language that's good for a lot of things. I mainly use it for data scraping, parsing, munging, etc, and more recently, for the Web, and I've left visualization up to other languages.

But why not use Python for visualization too? That way you can have everything in one language and all the gears can fit together a little easier. Beginning Python Visualization (BPV) by Shai Vaingast is a guide to help you do this.

While you might need a little bit of programming experience to fully make use of this book, Vaingast provides plenty of examples and explanations for you to easily learn how to use Python's visualization options.

What Beginning Python Visualization Covers

I should back up a little bit first. BPV doesn't just cover the actual visualization options. It starts from the very beginning (well, close to it at least) - at the data. It goes into some about how to collect data and then goes deeper into reading, parsing, and formatting your data once you've got it.

There are a lot of online tutorials on how to do that stuff, but it was good to have everything in one place and to find out the right way to do things from an expert.

After the data munging section, BPV gets into the visualization topics you'd expect. It starts with your basic graphs and how to draw in Python. It then covers more scientific visualization with splines, interpolation, and some signal processing.

You can look at the table of contents on the Amazon page for more details on book content.

Who this is For

BPV is for a semi-technical audience. If you have absolutely no programming experience, then this book probably isn't for you.

My main reason for saying this is not because the examples are confusing - they're pretty straightforward; rather, a lot of the code and explanations in BPV rely on Python packages like SciPy, NumPy, and Matplotlib. That means you have to install these before you can go through the examples, which took a while for me to get working, but maybe that's just me.

The Bottom Line

Once I got the packages installed correctly though, it was smooth sailing. Everything is explained clearly, and I'm sure I'll be referring back to it as I use Python more.

Bottom line: If you're a coding beginner, this book could be useful to you if you can get someone to install a few Python packages on your system. If you do know a little bit of Python though and want to use it to visualize data, Beginning Python Visualization is a good book to have that can serve as a guide and a handy reference.

UPDATE: Get a free copy

Leave a comment below by this Sunday at 8pm EST, and I'll select someone at random for a free e-copy of Beginning Python Visualization. Make sure you use a valid email address so I can contact you if you win. Thanks, Apress!

69 Comments

  • Thanks! I had tried to order this but it was out of stock, now arriving in 3 days, hope the Amazon link rattles your tip jar.

    There is an interesting interview at the Python411 podcast with the author.

    Also, if people have trouble with installation of dependencies, they might try a program called Reinteract, which takes an interesting approach to python visualization — it renders images inline, alongside the interpreter. See reinteract.org.

  • Sounds like it might be worth checking out EPD: a cross-platform Python distribution that includes SciPy, NumPy, and powerful visualization tools such as Chaco (2D) and Mayavi (3D). It’s also free for academic use…

    • thanks, i came across that a few times while going through documentation. it seems to be very highly recommended. but i decided to trudge through… it’s amazing what we go through for the price of free.

  • Any book recommendations for the true beginner?

    • Hi, Barrett,

      Mark Pilgrim has released Dive Into Python freely, and it’s well-written. I’ve not really delved deeply, so take my impressions with a grain of salt. However, it seems fairly well-received.

    • (I think a previous comment along these lines might have been spam-trapped for excess links — here is a googleable version)

      A great print book: “Core Python Programming” by Wesley Chun — author is a gifted teacher as well as programmer.

      Some great free online resources:

      “How to Think Like a Computer Scientist: Learning with Python” By Allen Downey of Olin College — really outstanding

      “A Byte of Python”

      The official Python tutorial

      The tutorial section of Python411, google that or “awaretek python tutorials”

      If you already have some fundamentals of programming you can read Mark Pilgrim’s “Dive Into Python”. It seems oriented towards people with C++ and Java backgrounds. It is a little heavy on things like xml and regular expressions for an introduction to programming, reflecting its original purpose.

      Your time spent learning this stuff is insanely well invested, you will be amazed.

  • Statisticians, infographicists and data visualizers. You find new perspectives never thought possible.

  • Awesome! I’m just wrapping up a project that relied heavily on NumPy and Matplotlib. The documentation is pretty good but very, very scattered.

  • The book sounds cool, I want it!

  • So when you say “at the beginning” you are referring to someone who can barely spell programming, right?

  • sounds like a good one. would definitely like to win a copy!

  • I’d love to learn more with Python. I’m also in the market to find some step-by-step examples of how to build standard Django applications, more examples than are in Django Book. Any suggestions?

  • Looks interesting. I recall working with visualizations in NodeBox a while back which used Python. It was fun and easy.

  • Choose me at random!

  • I’ve had my eye on this book since I first heard about it. Be nice to have my very own copy. :)

  • Cool, there are already lot of books out there in bookshelf, visualization using R, ggplot, ggboi, processing and hope to read this one by end of this year!!!!!!!!!!!

  • I want it! but I’ll prefer in Ruby instead of Python :-D

  • Thanks. The book sounds very useful to me.

  • Saad Abdali June 19, 2009 at 12:54 pm

    Perl or Python… why not both? ;) Thanks for the contest, crossing my fingers….

  • Nice book,even I would prefer ruby over
    python..

  • i like free books.

  • I’ve been looking for an excuse to learn Python anyway..

  • I can learns python? kthnxbai

    But seriously will probably pick this up anyway. Thanks for the tip.

  • Tom Schneider June 19, 2009 at 1:24 pm

    I would really like to get more into visualization, so I would like to see what Python has to offer.

  • Reviews on books are a great help when some of us don’t have a good technical bookstore nearby.

  • Chris Hamant June 19, 2009 at 1:40 pm

    Always looking to learn a bit more!

  • Crackhead June 19, 2009 at 1:44 pm

    This looks phenomenal! Thanks for the review.

  • kevin white June 19, 2009 at 1:45 pm

    Does the book cover integration with Sage or R?

  • free book, please.

  • random drawings are fun…

  • interesting book.

  • Sounds like an awesome book. I hope I can win one all else fails I pick it up. It always nice to have a ref about data mining.

  • Although it sounds a useful book for a lot of people I wish that authors–or is it publishers?–would not assume that we all need introducing to basics in every book that we buy.

    Thanks very much for providing the review.

  • Cool. How do I get to random so I can be selected for the free e-book?

  • Never used Python before, might be worth taking a look at.

  • A free copy of this book would make my heart sing. Sing, I say!

  • I hearts me some Python. And data. And visualization.

  • Will you be using an algorithm within Python to make the random selection? +)

    Also, in the same vein, you may try the Sage project, which makes excellent use of Python to provide a common interface to Maxima, NumPy, SciPy, Matplotlib, as well as Maple, Mathematica, and other commercial ventures. Additionally, the Sage developers have built their own procedures and function groups. All of the open-source pieces noted above are bundled in a single install, with very minimal fuss.

    From the 4.01 release notes:

    In version 4.0.1, doctest coverage increased by 0.3%, while an additional 177 functions have been added. The overall weighted coverage score is now at 77.2% and the total number of functions is at 21,988.

    21,988. Nice.

  • I’ve been looking for a good text on this subject…sign me up!

  • Mario Talavera June 19, 2009 at 3:40 pm

    A comment for a book! congrats to who wins.

  • Carlos Santos June 19, 2009 at 3:43 pm

    I’m a little surprised that you had trouble installing the dependencies. Have you tried to install from source? There are binary packages for Linux and Windows that make installing very easy, I’m not sure how it would be on a Mac, though. Besides EPD, suggested above, there is also Python(x,y) (pythonxy.com) that bundles python, scipy, mayavi, etc in one package.
    I wonder how useful the book would be for someone already familiar with matplotlib and scipy. Scipy documentation is very sketchy in some places, so the book might be valuable even for those.

    • It was mostly because I’ve been using Apple’s packaged Python, and Scipy binary wanted the system version. So I tried installing from source to get around installing Python, but that sorta sucked. So after fussing with that, I had to get all my paths and dependencies straightened out.

      But yeah, once I took care of that, I think all of the binary packages took care of things. I don’t remember exactly. It was late :P

  • I’m just starting to use numpy and scipy.

  • Sounds like a good book!

  • Awesome. I’m in :) Yay for Python and visualizations.

  • WANT!

  • Cool
    I am in

  • Good book review. I’ll have to take a deeper look. Python is definitely a great language. I was going to start with NetworkX, but the book seems like it might be good primer before diving directly into a data visualization package.

  • I haven’t used python since taking an introductory CS class…maybe I should revisit it!

  • love python, just getting into the visualization stuff now. looks like a good book!

  • interesting, I would also like to take a look at a sample chapter

  • I’ve been waiting for a book like this. I use Python at work and for personal work every day. Doing visualizations of quantitative data collected from HCI experiments is so much easier in Python than any other language. I’ve never really gotten into matplotlib though. This book could be the start of a beautiful relationship :)

  • Yay Python. Rock on.

  • Not a strong programmer so would be a good help. cheers!

  • Flicked through the table of contents – looks great! As an engineer/scientist I made the plunge a couple of years ago and switched from Matlab to python. As a user, it’s been great to see the python scientific stuff develop into a mature and stable product suite. The ONE gripe I have at the moment is 3D plotting – 2D is awesome with matplotlib, and mayavi/VTK etc. looks great for fancy 3D stuff, but if I just want to draw up a quick 3D surface from a numpy array, it takes way too much effort.

    Also, I stumbled across python(x,y) recently – makes installing a VTK based visualisation system a heck of a lot easier than it used to be (I tried on windows a while ago, and gave up with unmet package dependencies etc.).

  • Sounds great – will definitely check it out!

  • Count me in for the free book drawing!

  • Looks like an interesting book. Thanks for pointing it out!

  • I want this book!

  • Born a libran June 20, 2009 at 2:11 pm

    Seems like an interesting book..

  • I like that so many books are coming out now with a practical bent that also address the fundamentals. I’ve been eyeing Gnuplot In Action from Manning; but this sounds cool too.

    The challenge for enterprise users is always getting everything together if it isn’t batteries included (IT frowns on these things).

  • Hmmmm I’m interested.

  • I need this book.

  • Are there any examples of python visualizations somewhere, perhaps on a website or gallery?

  • I would love a copy of this book!

    Thanks!

  • That’d be funny if one of your comments was the one you select :)

  • carrotderek June 21, 2009 at 3:47 pm

    Looks like an interesting book, would love to check it out