Back to index
OtherAround 580 pages across 13 chapters, four to eight weeks working through it·Free online, around $60 in print

Python for Data Analysis, Third Edition (Wes McKinney)

4.4

The reference for the library you will spend more time in than any modelling framework, from the person who wrote it. Dry, thorough, and it teaches the tool rather than the craft of analysis.

What We Liked

  • Free to read online in full, with a print edition if you want one
  • McKinney created pandas, so the explanations of why things behave as they do are definitive
  • The group by and reshaping chapters cover the operations that consume most of your day
  • Third edition is properly modernised for current pandas rather than lightly patched
  • Time series material is unusually thorough and hard to find elsewhere at this quality

What Could Be Better

  • Reads like documentation in long form, and there is very little narrative to carry you
  • Teaches the library, not analysis, so you learn how and rarely why
  • Almost nothing on machine learning or statistics beyond descriptive work
  • Says little about performance, which is where pandas bites people hardest in practice
  • Ignores the newer dataframe libraries that are genuinely displacing pandas for large data

Detailed review

Every survey of how data scientists spend their time produces the same uncomfortable finding, which is that the modelling is a small slice and the rest is getting data into a state where modelling is possible. That work happens in pandas for most people in this field, and being slow at pandas is a tax you pay every single day. This is the book that removes it, written by the person who created the library, which gives it an authority nothing else has. The authorship shows most in the explanations of behaviour.

Pandas has a reputation for surprising people, and a lot of that surprise comes from design decisions that are entirely reasonable once you know the reasoning and completely baffling if you do not. Why indexing has several different forms and when each applies. What alignment does when you combine objects with different indexes, which is either the most useful feature in the library or the source of a silent bug depending on whether you were expecting it. Why the copy versus view distinction exists and why that warning keeps appearing.

McKinney explains these as consequences of the design rather than as quirks to memorise, which is the difference between a user who works around the library and one who works with it. The middle chapters are the valuable core. Group by operations, which is the single most important pattern in data manipulation and the one people most commonly write badly. Reshaping between wide and long form, merging and joining, handling missing data properly rather than dropping rows and hoping.

These are the operations that make up the bulk of real analysis code, and having them explained systematically rather than assembled from search results is worth a great deal. I have watched people's productivity change measurably after working through this section, because they stop writing loops over rows and start expressing what they actually want. The time series chapters deserve specific mention because they are excellent and the material is hard to find at this quality anywhere else. Resampling, rolling windows, time zone handling, period arithmetic, the specific and genuinely difficult problems of irregular series.

Anybody working with anything timestamped will use this repeatedly. The third edition is a real update. Pandas changed substantially over the years between editions, and the book reflects current practice rather than being the second edition with patches. It is also free online in full, which combined with the print option is the right way to publish a reference.

Now the criticisms. It is dry. This reads like extremely well organised documentation, and there is very little to carry you through a chapter you did not specifically need. Compare it with something like Fluent Python, where the author is making an argument and you want to keep reading.

This is a catalogue of capability, thorough and joyless. That makes it excellent as a reference and hard work as a cover to cover read, and most people should probably accept that and use it accordingly. The more important limitation is one of scope. This teaches the tool and not the craft.

You will learn what group by does, in detail, and almost nothing about when aggregating is the right move, what to look for in a new dataset, how to tell a genuine pattern from an artefact of how the data was collected, or what questions to ask before you start. Those are the skills that distinguish a good analyst, and this book does not attempt them. Pair it with something that does, because the combination of tool fluency and no analytical judgement produces work that is fast and wrong. There is also very little modelling.

Some statistical library material appears near the end, and it is a brief tour rather than a treatment. This is a data manipulation book and the title is honest about that, and buyers sometimes are not clear on it. The performance gap is the omission that costs users most. Pandas is easy to write slowly, and the difference between vectorised operations and row wise iteration is often two orders of magnitude.

Memory behaviour surprises people constantly, particularly the moment a dataset that fits on disk does not fit in a dataframe. The book covers some of this and not nearly enough given how much pain it causes. Related, the ecosystem has moved. Polars and DuckDB in particular are genuinely better choices for a range of workloads now, and the arrow backed future of dataframes is a real consideration.

This book is about pandas and pandas remains the default, so that focus is defensible, and a reader would still benefit from a chapter on when to reach for something else. My 4.4 is for a definitive reference on a library you cannot avoid, written by the person best placed to explain it, available free, and limited by being a manual rather than an education. Read it once properly, then keep the tab open for the next decade.

[ final ]

The verdict.

Work through it once early, then keep it open as a reference forever. Do not expect it to teach you what to do with the data, only how to move it.