Python for Data Analysis (3rd Edition) cover

Python for Data Analysis (3rd Edition)

Rating 4.0
Word count
635K words
Chapters
17
ISBN
9787111726722

Tags

Summary

This book is the third Chinese edition of Python for Data Analysis, whose author Wes McKinney is the creator of the open-source Python data analysis library pandas. The book follows the Python data science toolchain as its main thread, unfolding in the order "environment and syntax foundations—NumPy array computing—pandas data processing—data cleaning and wrangling—visualization—group aggregation—time series—modeling library interfaces—practical case studies." The third edition has been systematically updated for Python 3.10 and pandas 1.4, removing outdated content and adding new features and tools. Reading this book, readers will learn to use IPython and Jupyter Notebook for exploratory computing; master NumPy's ndarray, slicing and indexing, boolean indexing, universal functions, and linear algebra at both basic and advanced levels; become proficient with pandas' Series and DataFrame to load, clean, transform, join, merge, and reshape data; use matplotlib, pandas, and seaborn to draw statistical graphics; use the GroupBy mechanism for split-apply-combine aggregation and summarize results with pivot tables and cross-tabulations; handle regular and irregular time series, including time zones, periods, resampling, and moving window functions; and finally, through case studies using Bitly data, the MovieLens 1M dataset, US baby names, the USDA food database, and the US Federal Election Commission database, string the tools of each chapter into a complete data analysis workflow. Appendices introduce advanced NumPy and more in-depth IPython usage. The book focuses on "how to use the tools and how to process data" rather than on statistical methods themselves, and the sample code and data are available on GitHub. For anyone who wants to use Python in place of spreadsheet software and statistical tools for everyday data processing, this is a reference book to keep at hand for the long term.

Editor's review

如果你已经在用 Python,却总觉得自己是在“写代码”,而不是在“处理数据”,这本书能补上中间那一段。作者是 pandas 的创始人,他讲这些库时带着设计者的视角:为什么 Series 和 DataFrame 要这样组织,什么时候该用向量化运算,缺失值、索引对齐、分组聚合这些概念之间是什么关系,都解释得清楚。 这一版按 Python 3.10 与 pandas 1.4 重写了不少内容,老版本里的淘汰写法被清理掉,新手不容易被过时语法带偏。书的结构也很省心:第 1 至 3 章处理环境和语法,第 4 章进入 NumPy,第 5 章起进入 pandas 核心,后面依次是数据加载、清洗、规整、可视化、分组、时间序列,最后用几个真实数据集做完整案例。前面几章读懂以后,后面的章节可以按需跳读,当作速查手册使用。 需要提醒的是,它对统计方法和建模只做接口层面的介绍,第 12 章点到 Patsy、statsmodels 与 scikit-learn 的衔接便收笔。想学假设检验或机器学习算法,需要另找专门的教材。但就“用 Python 把脏数据整理成可分析的数据”这件事而言,它仍是绕不开的一本。

Who it's for

A good fit for

  • 已具备基础 Python 语法、想系统掌握数据分析工具链的读者
  • 需要每天用 pandas 处理表格数据的分析、运营、财务与业务岗位
  • 从 Excel、SPSS、R 转向 Python 的数据分析从业者
  • 需要为课程项目或作业准备数据处理脚本的数据科学、统计专业学生
  • 想通过官方示例数据打牢 NumPy 与 pandas 功底的工程师

Not a good fit for

  • 完全没有编程经验、连变量和循环都没写过的人
  • 想重点学习统计学原理、假设检验或机器学习算法的读者
  • 只想快速学会某个可视化图表库、不愿系统读书的人

Reading tips

  1. 先把第 1 至 3 章的环境配置跑通,能打开 Jupyter Notebook 并运行示例代码后再往后读。
  2. 第 4、5 章一定要动手敲一遍,边读边用 GitHub 上的示例数据验证结果,避免只“看懂”不“会用”。
  3. 第 6 至 11 章可按工作需求跳读,遇到具体问题时回来查对应小节,把它当手册而不是小说。
  4. 第 13 章的案例建议独立重做一遍,再换自己的数据集改写脚本,这是检验是否真掌握的快捷方式。
  5. 阅读时核对所用 pandas 与 NumPy 版本,库更新较快,遇到弃用警告以官方文档为准。

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. Translator's Preface
  2. Preface
  3. Chapter 1: Preliminaries
  4. Chapter 2: Python Language Basics, IPython, and Jupyter Notebooks
  5. Chapter 3: Built-in Data Structures, Functions, and Files
  6. Chapter 4: NumPy Basics: Arrays and Vectorized Computation
  7. Chapter 5: Getting Started with pandas
  8. Chapter 6: Data Loading, Storage, and File Formats
  9. Chapter 7: Data Cleaning and Preparation
  10. Chapter 8: Data Wrangling: Join, Combine, and Reshape
  11. Chapter 9: Plotting and Visualization
  12. Chapter 10: Data Aggregation and Group Operations
  13. Chapter 11: Time Series
  14. Chapter 12: Introduction to Modeling Libraries in Python
  15. Chapter 13: Data Analysis Examples
  16. Appendix A: Advanced NumPy
  17. Appendix B: More on the IPython System

FAQ

这本书适合零基础学 Python 的人吗?
不太适合。书中第 2、3 章只是快速复习语法、数据结构和文件操作,节奏较快,重心在 NumPy 与 pandas 的使用。建议先掌握变量、循环、函数、字典和列表等基础,再读本书会顺畅得多。
第 3 版和第 2 版主要差别在哪里?
第 3 版针对 Python 3.10 和 pandas 1.4 重写了示例,清理了过时或不兼容的写法,更新了数据加载、扩展数据类型和可视化等内容,并调整了部分案例的数据源。已有第 2 版且只做常规处理的话,不必急着更换。
书中的代码和数据在哪里获取?
作者在 GitHub 上公开了配套的示例代码与数据文件,各章前言和英文版官方页面也给出了仓库地址。建议下载后与所读版本对应,避免因版本差异出现报错。
读这本书能学会机器学习吗?
不能。第 12 章只介绍 pandas 与 statsmodels、scikit-learn 等建模库的衔接方式,重点在于把数据整理好之后如何交给模型。要学算法原理和调参,需要另找专门的机器学习教材。
书里的表格数据处理方法能直接用到工作中吗?
大部分可以。数据加载、缺失值处理、连接合并、分组聚合、透视表和时序重采样都是工作中高频操作,改写脚本即可使用。但真实数据格式更杂,遇到编码、日期格式、超大文件等问题仍需查阅官方文档。

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.

About the author

Wes McKinney is a technical author known for his work on data analysis and scientific computing, and his Chinese name is often associated with the topic of Python data analysis among readers of computer books. Publicly available information is limited: his nationality, birth and death dates, and educational background are not conclusively recorded, and the library currently holds one of his works. His representative work is Python for Data Analysis (2nd Edition), which focuses on the practical use of Python in data processing, cleaning, wrangling, and analysis. The book emphasizes tool operation and case demonstrations and is a practical technical work in the general computer category. McKinney's writing style combines programming methods with real data scenarios; the language is direct and the steps are clear, making it suitable for readers who want to use Python for data analysis. The book has circulated widely among Chinese readers, is often regarded as one of the introductory works for entering the field of Python data analysis, and reflects the author's practical experience and approach to data handling.

More by the same author

Top rated in the same category