Python for Data Analysis (3rd Edition) cover

Python for Data Analysis (3rd Edition)

No rating yet
Word count
635K words
Chapters
16
ISBN
9787111726722

Tags

Summary

This book is one of the most widely circulated and classic hands-on works in the field of Python data analysis, written by Wes McKinney, creator of the pandas library, translated by Chen Song, and published by China Machine Press. The book unfolds around real analysis and processing workflows, introducing from easy to difficult the whole process of using Python to acquire, clean, transform, aggregate and present data. The book begins with preparation, explaining why Python is used for data analysis and introducing core tools such as pandas, NumPy, matplotlib, IPython and Jupyter; it then covers Python syntax basics, interactive use of IPython and Jupyter notebook, built-in data structures, functions and file operations. The middle section focuses on NumPy's ndarray, vectorized computation, universal functions and linear algebra, as well as pandas' Series, DataFrame, index alignment and descriptive statistics. It then moves into practical data processing topics: reading and writing text, binary, Web APIs and databases; handling missing values and data types; string and categorical data operations; hierarchical indexing, merging and joining, reshaping and pivoting; plotting with matplotlib and seaborn; groupby aggregation and the split-apply-combine paradigm, pivot tables and cross-tabulations; and time series date ranges, time zones, resampling and moving windows. The final two chapters introduce how modeling libraries such as Patsy, statsmodels and scikit-learn connect with pandas, and demonstrate complete analysis cases using real datasets including Bitly's 1.USA.gov data, MovieLens 1M, U.S. baby names from 1880 to 2010, the USDA food database and the 2012 Federal Election Commission database. Appendices supplement advanced NumPy and IPython content. This edition is fully updated for Python 3.10 and pandas 1.4, removes no-longer-compatible old tools, adds new features and methods, and all examples run in Jupyter. At about 635,000 characters, it is an irreplaceable desktop reference for systematically learning Python data processing.

Editor's review

为什么这本书值得反复推荐?因为作者韦斯·麦金尼就是 pandas 的缔造者。没有人比他更清楚这个库为何这样设计,也没有人能把“数据该怎么规整”讲得如此贴合实际工作流程。市场上大量数据分析书只是零散罗列 API,而本书沿着“读入—清洗—整合—聚合—可视化—建模”的真实链路推进,读完之后你得到的是解决的问题的思路,并非一堆孤立的函数。 第3版的价值在于“不过时”。全书基于 Python 3.10 和 pandas 1.4 重写,清掉了早期版本里已废弃的写法,补充了新的索引机制、扩展数据类型、分类数据和更现代的绘图方式。对于工作中直接使用 pandas 的开发者和分析师来说,这一点几乎决定了这本书能不能放在手边随手翻。 实用性方面,第13章的案例用 Bitly 短链数据、MovieLens 评分、婴儿姓名统计、食品营养数据库、政治献金等真实数据集,展示了一份数据从原始状态被折腾成结论的全过程,这部分单独拿出来都值回书价。附录对 NumPy 高阶用法和 IPython 的深入讲解,也让这本书能撑得住“工具参考书”的角色。 当然要提醒一句:本书是“工具与流程”书,并非统计和机器学习教材;作者本人也明确表示,统计与建模的具体操作交给当时最流行的库即可,因此这部分讲得较简略。另外中文译文偶有生硬之处,遇到难懂的段落不妨对照代码和官方文档理解。把它当成长期查阅的案头手册,会比逐页背诵收获更大。

Who it's for

A good fit for

  • 已掌握 Python 基本语法、希望系统学习数据处理的分析师或数据科学初学者
  • 日常用 pandas 和 NumPy 工作、需要一本随查随用参考书的数据从业者
  • 统计学、经济学、金融等专业需要把课程数据真正跑出来的学生与研究者
  • 希望把 Excel 工作流迁移到 Python、提升自动化处理能力的职场人

Not a good fit for

  • 完全没有编程基础、尚未写过任何 Python 代码的零起点读者
  • 想系统学习统计学原理、机器学习算法数学推导的读者
  • 只做可视化报表、需要大量 BI 工具与图表美学内容的人

Reading tips

  1. 先按第2、3章快速过一遍 Python 与 Jupyter 基础,再进入第4、5章,不要跳过 NumPy 直接学 pandas。
  2. 每章都在 Jupyter 中跟着敲一遍代码,再用自己的数据改写示例,比只读不练有效得多。
  3. 第6—11章可按工作需求跳读:需要处理时间数据就重点做第11章,需要报表就先啃第9章。
  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: Python Language Basics, IPython, and Jupyter Notebooks
  4. Chapter 3: Built-in Data Structures, Functions, and Files
  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 Cleaning and Preparation
  9. Chapter 8: Data Wrangling: Join, Combine, and Reshape
  10. Chapter 9: Plotting and Visualization
  11. Chapter 10: Data Aggregation and Group Operations
  12. Chapter 11: Time Series
  13. Chapter 12: Introduction to Modeling Libraries in Python
  14. Chapter 13: Data Analysis Examples
  15. Appendix A: Advanced NumPy
  16. Appendix B: More on the IPython System

FAQ

这本书适合零基础学 Python 的人吗?
不太适合完全零基础者。虽然前两章讲了 Python 语法与 IPython,但节奏较快,重点在数据工具。建议先掌握变量、列表、字典、函数、循环等基础,再回头读本书会顺畅很多。
第3版和第2版主要差别在哪里?
第3版基于 Python 3.10 和 pandas 1.4 重写,删除了已废弃的旧工具,更新了全部示例代码,并补充了新特性,如扩展数据类型、分类数据处理等。版本较新的话优先选第3版。
书里的代码和数据从哪里获取?
原书配套的数据文件和 notebook 发布在 GitHub 上的作者仓库(wesm/pydata-book),按书中说明克隆或下载后即可在 Jupyter 中运行,建议使用与该版匹配的 pandas 版本。
学完后能直接做数据分析工作吗?
能覆盖数据处理主要环节:读取、清洗、整合、分组聚合与可视化。但统计建模部分讲得较浅,要胜任完整分析岗,还需另行补充统计推断、机器学习与业务知识。
微信读书上显示的字数为什么和纸质版不一样?
电子版字数(约 14.7 万字)统计口径与纸书版权页标注(约 63.5 万字)不同,电子版通常按文本字符计,且不含大量代码排版与图表,两者并不矛盾。

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