pydata-book README

The project's README from github.com/wesm/pydata-book. As one markdown file: README.md.

Python for Data Analysis, 3rd Edition

Materials and IPython notebooks for "Python for Data Analysis, 3rd Edition" by Wes McKinney, published by O'Reilly Media. Book content including updates and errata fixes can be found for free on my website.

Buy the book on Amazon

Follow Wes on Twitter: Twitter Follow

Setup Instructions

uv is a fast Python package installer and resolver. To get started:

  1. Install uv if you haven't already:
curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Start Jupyter Notebook with all dependencies:
uv run jupyter notebook

That's it! uv will automatically create a virtual environment and install all required packages from pyproject.toml.

Option 2: Using Conda

  1. Create a new conda environment:
conda create -n pydata-book python=3.11
conda activate pydata-book
  1. Install dependencies:
pip install -r requirements.txt
  1. Start Jupyter Notebook:
jupyter notebook

Note: This project uses pandas 2.0.3 to ensure compatibility with the notebooks.

2nd Edition Readers

If you are reading the 2nd Edition (published in 2017), please find the reorganized book materials on the 2nd-edition branch.

1st Edition Readers

If you are reading the 1st Edition (published in 2012), please find the reorganized book materials on the 1st-edition branch.

IPython Notebooks:

License

Code

The code in this repository, including all code samples in the notebooks listed above, is released under the MIT license. Read more at the Open Source Initiative.

pydata-book (wesm/pydata-book)

Searching Database…

这是什么?这是 Wes McKinney 所著《Python for Data Analysis》一书的配套仓库,包含 Jupyter Notebook 笔记本和相关材料,涵盖 pandas、NumPy 以及数据分析技术。
这是独立的库,还是只是这本书的笔记本?这只是一组跟随书中章节的 IPython/Jupyter 笔记本,不是可以导入其他项目的库或包。
我该怎么运行这些笔记本?推荐使用 uv 自动创建虚拟环境,并从 pyproject.toml 安装依赖,然后启动 Jupyter Notebook;也可以创建 conda 环境并安装列出的依赖。
我需要特定版本的 pandas 吗?需要。项目固定使用 pandas 2.0.3,以确保笔记本的输出与书中完全一致。
如果我读的是旧版图书怎么办?本仓库默认对应第 3 版。如果读者使用的是第 2 版或第 1 版,需要切换到专门的 2nd-edition 或 1st-edition git 分支,因为 main 分支的内容与旧章节不匹配。
章节涵盖哪些主题?内容依次介绍 Python 基础、NumPy 数组、pandas 基础、数据加载、清洗与整理、绘图、聚合、时间序列、建模库入门,以及完整的数据分析示例,另外还有一个 NumPy 高级附录。
我能在这里看到书的正文吗?不能,本仓库只包含代码笔记本。完整的书籍内容(包括更新和勘误)由作者在其网站上免费提供,也可以在亚马逊购买。
Creator
wesm
Size
63.7 MB
Stars
25K
Updated
CommitOct 17
Age
14y
Commits · 90 Days