Craig Maloney writes “Ever since there was a collection of numbers, it seems that invariably someone will want a graph of those numbers. There are literally hundreds of different styles of graphs, and almost as many programs and tools to make those graphs. Matplotlib, a library and toolkit for the Python language, provides an easy and effective way to make some impressive graphics with little more than a smattering of Python. Matplotlib for Python Developers is equally impressive at distilling the core set of features of Matplotlib in a way that shows the reader how to get the most out the Matplotlib toolkit.” Read below for the rest of Craig’s review.
|Matplotlib for Python Developers|
|summary||A comprehensive overview of the powerful Matplotlib Python library|
The next chapter introduces more advanced plotting concepts that Matplotlib is capable of handling. The chapter begins with the three ways that Matplotlib may be used (The pyplot module, pylab, and the Object Oriented interface). From there, the book delves into subplots, multiple figures, additional axes, logarithmic axes, date plotting, contour plots, and image plots. Also included are sections on using LaTeX and TeX with Matplotlib, both for exporting graphs, as well as using TeX inside plots via Mathtext. By the end of the chapter, I felt very comfortable with the environment and the capabilities of Matplotlib, both as an interactive environment, and as a module for my own programs.
The next four chapters cover integrating Matplotlib with GTK+, QT4, wxWidgets, and web-based environments. The chapters for GTK+, QT4, and wxWidgets each begin by presenting a basic overview of the toolkit, and why one might want to use that particular toolkit. Next, the book shows how to embed a Matplotlib figure in a window, both with static and real-time data input. The book then shows how to use the toolkit’s builder with Matplotlib (Glade for GTK+, QT Designer for QT4, and wxGlade for wxWidgets. The chapter on web development veers slightly from this format by showing several examples of using CGI and mod_python with Matplotlib before showing how to use Matplotlib with Django and Pylons.
The last chapter pulls together some “real world” examples together for the grand finale. The examples clearly show how Matplotlib would work for such plotting Apache web logs, fitting curves, and plotting geographic data. The geographic data plotting uses an additional module called basemap, which allows for plotting precisely on a map. This example floored me with the amount of power that Matplotlib possesses.
Overall, I found this book to be informative, without a lot of fluff. The organization of the book sometimes dipped into a chaotic presentation of “oh, look at this”, but overall the author kept a very even pace, with clearly defined goals and clean resolution of those goals. Matplotlib for Python Developers is definitely a book that I would pick up to refresh my memory for using Matplotlib. The asking price is a bit steep for book that is just shy of 300 pages, but overall I highly recommend it for anyone looking to get started with this exceptional library. I’d also recommend it for anyone looking for alternatives to some of the other plotting packages available. Matplotlib is quite powerful, and Matplotlib for Python Developers makes this power very accessible.
You can purchase Matplotlib for Python Developers from amazon.com. Slashdot welcomes readers’ book reviews — to see your own review here, read the book review guidelines, then visit the submission page.
Source: Matplotlib For Python Developers
thatpythonguy writes “Learning Python is a well-written book by an experienced Python trainer that has served the Python community well since the first edition was published in 1999. Now, at its fourth edition, this book by Mark Lutz continues to arguably be Python’s bible.” Read on for the rest of Ahmed’s review.
|Learning Python, 4th Edition|
|summary||A hands-on book that will help you be productive with Python 3.0 quickly|
Both Python 2.6 and 3.x are covered in this edition. However, the latest 3.x line is considered the reference from which variations in 2.6 are discussed when appropriate. This approach is logical; the new Python 3.x presents a major change to the language, but is not sufficiently dominant to warrant exclusive treatment.
This book discusses the Python language and excludes the Python standard and non-standard libraries. The latter are discussed in other places including Lutz’s own Programming Python which stands at its third edition at the time of writing of this article. I find this division necessary because of size considerations and, in fact, this division did not exist in the first edition of the book! However, there is one topic that does not seem to fit the language/libraries divide, and that topic is packaging and deployment.
I will argue that there are not many (if any) books that discuss packaging and deployment of Python programs well. I will also argue that this topic should be included in the book being reviewed here since it is so essential to real Python programming. Since Lutz discusses the Python runtime environment, I do not think it detracts from the book’s coherence to include a chapter on packaging.It is possible that the proliferation of various packaging and deployment options such as distutils, setuptools, pip, buildout, virtualenv, paver, fabric and others, is the reason for this exclusion. Or it could be that these tools are in a state of major flux that any text will become quickly outdated. If size is the reason for this exclusion, maybe Lutz or someone else can publish ‘Packaing and Deploying Python’ as a separate volume.
The book starts by building a case for the use of Python. Both the features of the language and its prominent users are discussed to build credibility. Then, the runtime environment is discussed: how to run programs in various ways on various operating systems and language interpreters.
Types and statements, which are at the core of any language, are discussed next. Notably, there is an excellent discussion of the topic of iterators and generators (also discussed in a later chapter). Functions, modules and classes are then introduced. The text also includes a discussion of general object-oriented programming (OOP) principles which I find to be invaluable as it brings the topic of classes to life.
Exceptions are introduced and discussed in detail. The placement here is appropriate since exceptions are now objects in Python so classes had to be discussed first. This chapter should prove to be especially useful for people migrating from other languages that do not have simple, yet effective, exception-handling constructs.
Finally, four advanced topics are covered: decorators, Unicode, managed attributes, meta-classes. I find the first two to be absolutely necessary for almost any system nowadays, even small ones! The atter two are not as ubiquitous, but should be useful to more experienced programmers.
I should mention here that the discussion of the topics discussed above does not stop at the basics but provides comprehensive coverage. This is evident in the discussion of concepts such as dynamic typing, inheritance order, iterators, generators, comprehensions, and functional programming, among many others. There is even an interlude on documentation and the pydoc library.
Like many programming texts, the book uses small programming examples (appropriately executed in the Python interactive shell). The small examples hope to capture the essence of the topic at hand, and that, it does well within the limitations of a small-scale context. But this fourth edition adds a new chapter on classes (Chapter 27) that contains a more realistic code example presented in a tutorial format.
In addition to examples, each chapter ends with a summary of the chapter’s content as well as a quiz on that content. The quiz is immediately followed by its answers for easy reference. I have to admit that I do not use any of these two features, so I will not be able to comment on their efficacy.
Like many O’Reilly books, this is a well-written, coherent, and beautifully type-set book. I highly recommend it to anyone who wants to, or already does, program using python. It should help the novice in the transition to an excellent programming language or, otherwise, make an already familiar environment more powerful in the hands of veterans.
Ahmed Al-Saadi is a Software Analyst who works for a Montreal Python house. He wrote his first lines of code on a Sinclair ZX Spectrum+, though unfortunately not in Python at the time.
Source: Learning Python, 4th Edition