Python for Data Analysis cover

Python for Data Analysis

Rating 4.3
Chapters
14
Series
O'Reilly Best-Selling Book Series
ISBN
9787111436737

Tags

Summary

This book is a classic introductory work in the field of Python data analysis. Originally titled Python for Data Analysis, it was written by Wes McKinney, a principal author of the pandas library, and published by O'Reilly Media in 2013. The Chinese edition was introduced by China Machine Press the same year, translated by Tang Xuetao and others. The book focuses on the concrete operational details and basic essentials of handling data with Python and its core open-source libraries, rather than on statistics or analytical methods themselves. It begins with setting up the environment, then successively introduces the IPython interactive development environment, NumPy's ndarray and vectorized computation, pandas' Series/DataFrame data structures and basic operations, then moves on to data loading and file format handling, data wrangling (cleaning, transformation, merging, reshaping), plotting and visualization with matplotlib, groupby aggregation and pivot tables, and time series processing, closing with applications to financial and economic data and advanced NumPy use, with an appendix summarizing essentials of the Python language. The book includes numerous runnable code examples and real dataset cases, such as the 1.usa.gov short-link data, the MovieLens 1M dataset, U.S. baby names from 1880 to 2010, the USDA food database, Haiti earthquake crisis data, and the 2012 Federal Election Commission database, helping readers apply the tools to real scenarios. Because the author is the creator of pandas, the book is also regarded as an authoritative reference for understanding pandas' design philosophy, and is suitable as a handbook for analysts new to Python and Python programmers new to scientific computing.

Editor's review

如果你只能在工作台边放一本 Python 数据分析书,这本大概是最经得起翻的一本。它的作者 Wes McKinney 正是 pandas 的创造者,所以书里对 DataFrame、索引对齐、groupby、重采样等机制的讲解不是二手转述,而是“造轮子的人”在解释轮子为什么长这样。很多读者后来才意识到,读懂这些设计动机,比记住几个 API 更能少踩坑。 结构上,全书是一条很干净的进阶路线:先 IPython,再 NumPy,然后 pandas 入门、数据读写、规整化、可视化、分组聚合、时间序列,最后落到金融经济案例与 NumPy 高级应用。每一部分都配真实数据集和可直接复现的代码,读完当章就能上手改自己的数据。它不是统计学教材,也不谈机器学习算法,正因如此,它把“把脏数据变成能分析的表”这件最耗时间的事讲得格外扎实。 需要提醒的是,本书对应 Python 2.x 与早期 pandas 版本,部分写法(如 .ix 索引器、旧版绘图接口)在今天已不适用。但数据操作的思维框架依然成立,配合官方文档阅读收益最大。

Who it's for

A good fit for

  • 已会基础 Python 语法、想系统学习 pandas 与 NumPy 的数据分析新人
  • 从 Excel、SQL 或 R 转来,需要大批量处理结构化数据的从业者
  • 金融、经济、社会科学领域做数据清洗与时间序列分析的研究者
  • 想理解 pandas 设计思路、建立规范数据操作习惯的工程师

Not a good fit for

  • 完全没有编程基础、需要从变量与循环学起的零基础读者
  • 想系统学习统计推断、建模方法或机器学习算法的人
  • 使用最新 pandas 2.x 与 Python 3.11+ 且要求代码可直接运行的读者

Reading tips

  1. 先照第1章装好环境,用 Conda 建独立环境,避免与系统 Python 冲突。
  2. 第2章的案例可先跑通再回头精读,带着问题读后面章节效率更高。
  3. 第4至第7章建议边读边用自己手头的 CSV 复现,重点练索引对齐与合并。
  4. 遇到代码报错先查官方文档,书中年份较早的写法多半已被官方推荐用法替代。

About the publisher

China Machine Press China · Founded in 1950

In addition to science and technology and professional publishing, the books in our catalog from China Machine Press also reflect a sustained focus on psychology, computing, management, finance and economics, and social sciences. In psychology, the catalog includes works by C. G. Jung and introductions to analytical psychology, as well as applied topics such as stress and health, and addiction and healing. In computing, it features Structure and Interpretation of Computer Programs (JavaScript Edition). Management and finance titles include Administrative Behavior (4th Edition), The Price of Inequality (Collector's Edition), and This Time Is Different: Eight Centuries of Financial Folly (Commemorative Edition). In the philosophy and history of science, there is The Worldview: The Third Edition. Relevant authors include C. G. Jung, William McGuire, Sonu Shamdasani, and Gabor Maté. Public information is limited; the above summarizes the publisher's profile based solely on the books in our catalog.

Contents

  1. Preface
  2. Chapter 1. Preliminaries
  3. Chapter 2. Introductory Examples
  4. Chapter 3. IPython: An Interactive Computing and Development Environment
  5. Chapter 4. NumPy Basics: Arrays and Vectorized Computation
  6. Chapter 5. Getting Started with pandas
  7. Chapter 6. Data Loading, Storage, and File Formats
  8. Chapter 7. Data Wrangling: Clean, Transform, Merge, Reshape
  9. Chapter 8. Plotting and Visualization
  10. Chapter 9. Data Aggregation and Group Operations
  11. Chapter 10. Time Series
  12. Chapter 11. Financial and Economic Data Applications
  13. Chapter 12. Advanced NumPy
  14. Appendix A. Python Language Essentials

FAQ

这本书和《利用Python进行数据分析》第2版、第3版有什么区别?
第1版(2013年,唐学韬译)基于 Python 2.x 与早期 pandas;第2版(2018年,徐敬一译)改按 Python 3.6 更新,引入 Jupyter,并替换了部分案例;第3版进一步适配 Python 3.10 与 pandas 1.4,新增对 scikit-learn 等工具的延伸。初学建议直接选较新版本。
零基础可以读这本书吗?
不建议完全零基础直接读。书中附录 A 虽概述了 Python 语言精要,但节奏很快。建议先掌握变量、列表、字典、函数、类与文件读写,再进入本书,否则会在讲 pandas 索引时卡住。
书中的代码现在还能运行吗?
核心逻辑大多可用,但部分写法已废弃,例如 .ix 索引器被 loc/iloc 取代,旧版 matplotlib 绘图参数也有变化。建议对照 pandas 官方文档调整,并把书当方法论读,而不是当代码手册照抄。
需要先学 NumPy 再学 pandas 吗?
不必等完全学透 NumPy。第4章掌握 ndarray、切片、广播与矢量化这四项,就足以支撑后面的 pandas 学习;更高级的 NumPy 内容可在读完第12章后再回补。

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

More by the same author

Top rated in the same category