No. 104 of 500 No. 7 in Hands-On AI & Programming

Python for Data Analysis

Data Wrangling with pandas, NumPy, and Jupyter

By Wes McKinney

Print length
579 pages
Publisher
O'Reilly Media
Reading level
Intermediate
ISBN-13
978-1098104030
Published
September 20, 2022
Written for
Analysts, data scientists and aspiring ML engineers who need fluent pandas and NumPy skills.

Synopsis

Wes McKinney created the pandas library while working in quantitative finance, and this book is his guide to using it, together with NumPy and Jupyter, to load, clean, reshape and analyze data in Python. It is written for analysts new to Python and for programmers new to scientific computing. Early chapters cover Python language basics, built-in data structures, the IPython shell and Jupyter notebooks, then move to NumPy arrays and vectorized computation, the foundation beneath pandas.

The core of the book works through pandas in practice: reading files and databases, handling missing values and messy strings, joining and reshaping tables, group-by aggregation, time series and plotting with matplotlib and seaborn. A short chapter introduces modeling libraries such as statsmodels and scikit-learn, and closing case studies apply the techniques to real public datasets. The third edition, released in 2022 and since updated online for pandas 2.0, can be read free in an open-access web version, with code and data on GitHub. Readers gain fluency in the data-wrangling work that consumes much of the effort in any machine learning or analytics project, though the book does not teach modeling itself.

Scorecard

Editorial score

How it scored

Editorial score: 86.8 / 1005 weighted criteria

  • Influence30%

    25.5/30
  • Authority25%

    23.8/25
  • Practical value20%

    18.0/20
  • Currency15%

    12.0/15
  • Readability10%

    7.5/10
  • Editorial score

    86.8/100

How the rank was computed

Rank No. 104 of 500 comes from a composite of 62.8: observable signals 23.7 of 55 points plus editorial review 39.1 of 45 points.

All 11 inputs
InputPoints
Observable signals23.7/55
Reach (Amazon ratings volume)10.0/16.5
Consensus across best-of lists5.5/13.8
Awards and bestseller evidence0.0/8.3
Reader rating, sample-adjusted6.7/8.3
Amazon sales rank1.5/5.5
Recency0.0/2.8
Editorial review39.1/45
Author authority10.7/11.3
Influence11.5/13.5
Practical value8.1/9.0
Readability3.4/4.5
Currency5.4/6.8

Each criterion is scored from 1 to 10 and weighted, and the points add up to the editorial score. The rank combines observable signals (55 percent) with this score (45 percent). Read the methodology.

Verdict

The authoritative pandas reference from its creator, essential for the data-preparation work that precedes nearly every machine learning project.

Strengths

  • Written by the creator of pandas
  • Free open-access edition updated for pandas 2.0
  • Thorough coverage of real data-cleaning tasks

Keep in mind

It is a tools reference rather than a machine learning book, and readers expecting model building or deep learning will need a companion text.

Key takeaways

  1. Vectorized NumPy and pandas operations replace slow Python loops, making it practical to explore and transform large tables interactively.
  2. Data preparation, meaning loading, cleaning, transforming and rearranging, takes a large share of analysis time, so mastering it pays off across projects.
  3. The split-apply-combine pattern behind pandas group-by handles a wide range of summarization and feature-engineering tasks with concise code.
  4. Jupyter notebooks support an exploratory workflow in which data can be inspected, transformed and visualized one step at a time.

Notable facts

  • The third edition is free to read in an open-access HTML version updated for pandas 2.0 and Python 3.10, with MIT-licensed code on GitHub. Source (opens in a new tab)
  • McKinney created the pandas library and serves as its “Benevolent Dictator for Life.” Source (opens in a new tab)

About the author

Wes McKinney

Wes McKinney began building the pandas library at AQR Capital Management and released it publicly in 2009. An MIT mathematics graduate, he co-founded Datapad, later acquired by Cloudera, worked on the Ibis and Apache Arrow projects, and launched Ursa Labs, which became part of Voltron Data. He joined Posit as a principal architect in 2023.

Questions

Is Python for Data Analysis good for learning machine learning?
Python for Data Analysis teaches the data preparation that machine learning depends on, not machine learning itself. Readers learn to load, clean, merge, reshape and summarize data with pandas and NumPy, which are prerequisites for building models. Only one short chapter introduces modeling libraries such as statsmodels and scikit-learn, so readers who want to train models should follow it with a dedicated machine learning text.
Which edition of Python for Data Analysis should I read?
Read the third edition, first released in 2022. Its open-access online version has been updated for pandas 2.0 and Python 3.10, while the earlier editions from 2012 and 2017 use older pandas syntax that has since changed. The online version is free to read, and the example code and datasets are available on GitHub under an MIT license.
Is Python for Data Analysis suitable for beginners?
Python for Data Analysis suits analysts who are new to Python and programmers who are new to data work, and it includes chapters on Python basics. Complete newcomers to programming may find the pace brisk, because the book moves quickly from language fundamentals to NumPy and pandas. Readers with some prior coding experience will get the most from its detailed, example-driven coverage.

Sources

As an Amazon Associate, Best AI Books earns from qualifying purchases. Best AI Books is sponsored by Iternal.ai, whose founder and CEO, John Byron Hanby IV, wrote The AI Strategy Blueprint, our #1 ranked book. How we rank books.