{"id":14989189,"url":"https://github.com/lijin-thu/notes-python","last_synced_at":"2025-10-08T01:12:40.050Z","repository":{"id":37412800,"uuid":"43877558","full_name":"lijin-THU/notes-python","owner":"lijin-THU","description":"中文 Python 笔记","archived":false,"fork":false,"pushed_at":"2020-10-01T15:06:58.000Z","size":11695,"stargazers_count":7009,"open_issues_count":11,"forks_count":2910,"subscribers_count":547,"default_branch":"master","last_synced_at":"2025-04-03T19:09:47.565Z","etag":null,"topics":["anaconda","matplotlib","numpy","python","scipy","theano"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lijin-THU.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-08T09:30:56.000Z","updated_at":"2025-03-31T08:50:11.000Z","dependencies_parsed_at":"2022-07-13T15:59:20.942Z","dependency_job_id":null,"html_url":"https://github.com/lijin-THU/notes-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lijin-THU%2Fnotes-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lijin-THU%2Fnotes-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lijin-THU%2Fnotes-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lijin-THU%2Fnotes-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lijin-THU","download_url":"https://codeload.github.com/lijin-THU/notes-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248335626,"owners_count":21086629,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anaconda","matplotlib","numpy","python","scipy","theano"],"created_at":"2024-09-24T14:17:49.790Z","updated_at":"2025-10-08T01:12:35.014Z","avatar_url":"https://github.com/lijin-THU.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Analytics](https://ga-beacon.appspot.com/UA-80121379-2/notes-python)](https://github.com/lijin-thu/notes-python)\n\n# 中文 Python 笔记\n\n\u003e 版本：0.0.1\u003cbr\u003e\n\u003e 作者：李金\u003cbr\u003e\n\u003e 邮件：lijinwithyou@gmail.com\u003cbr\u003e\n\n由于涉及著作权的问题，对基于本笔记所做的修订、改编，目前不做任何正式授权。\n\n笔记内容仅供学习参考，未经允许，请勿用于任何商业用途。\n\n`Github` 加载 `.ipynb` 的速度较慢，建议在 [Nbviewer](http://nbviewer.ipython.org/github/lijin-THU/notes-python/blob/master/index.ipynb) 中查看该项目。\n\n基于本笔记的实体书：《自学Python——编程基础、科学计算及数据分析》已经出版。\n\n京东自营链接：\nhttps://item.jd.com/12328920.html\n\n天猫、亚马逊、当当均有销售。\n\n**打赏一下意思意思？**\n\n![](payment.jpeg)\n\n---\n\n## 简介\n\n大部分内容来自网络。\n\n默认安装了 `Python 2.7`，以及相关的第三方包 `ipython`， `numpy`， `scipy`，`pandas`。\n\n\u003e life is short. use python.\n\n推荐使用 [Anaconda](http://www.continuum.io/downloads)，这个IDE集成了大部分常用的包。\n\n笔记内容使用 `jupyter notebook` 来展示。\n\n安装好 `Python` 和相应的包之后，可以在命令行下输入：\n\n```\n$ jupyter notebook\n```\n来进入 `jupyter notebook`。\n\n----\n\n## 基本环境配置\n\n- 安装 [Anaconda](http://www.continuum.io/downloads) 或者 [Miniconda](http://conda.pydata.org/miniconda.html)\n\n- 更新环境\n``` \nconda update conda\nconda update anaconda\n```\n\n---\n\n## 参考\n\n- [Enthought Training on Demand](https://training.enthought.com/)\n- [Computational Statistics in Python](http://people.duke.edu/~ccc14/sta-663/index.html#rd)\n- [Scipy.org](http://scipy.org/)\n- [Deep Learning Tutorials](http://deeplearning.net/tutorial/)\n- [High Performance Scientific Computing](http://faculty.washington.edu/rjl/uwhpsc-coursera/index.html)\n- [Scipy Lectures](http://www.scipy-lectures.org/)\n- [Pandas.org](http://pandas.pydata.org/pandas-docs/stable/index.html)\n\n----\n\n## 目录\n\n可以在 Notebook 中打开 `generate static files.ipynb`，或者命令行中运行代码 `generate_static_files.py` 来生成静态的 HTML 文件。\n\n---\n\n- [01. **Python 工具**](01-python-tools)\n\t - [01.01 Python 简介](01-python-tools/01.01-python-overview.ipynb)\n\t - [01.02 Ipython 解释器](01-python-tools/01.02-ipython-interpreter.ipynb)\n\t - [01.03 Ipython notebook](01-python-tools/01.03-ipython-notebook.ipynb)\n\t - [01.04 使用 Anaconda](01-python-tools/01.04-use-anaconda.ipynb)\n- [02. **Python 基础**](02-python-essentials)\n\t - [02.01 Python 入门演示](02-python-essentials/02.01-a-tour-of-python.ipynb)\n\t - [02.02 Python 数据类型](02-python-essentials/02.02-python-data-types.ipynb)\n\t - [02.03 数字](02-python-essentials/02.03-numbers.ipynb)\n\t - [02.04 字符串](02-python-essentials/02.04-strings.ipynb)\n\t - [02.05 索引和分片](02-python-essentials/02.05-indexing-and-slicing.ipynb)\n\t - [02.06 列表](02-python-essentials/02.06-lists.ipynb)\n\t - [02.07 可变和不可变类型](02-python-essentials/02.07-mutable-and-immutable-data-types.ipynb)\n\t - [02.08 元组](02-python-essentials/02.08-tuples.ipynb)\n\t - [02.09 列表与元组的速度比较](02-python-essentials/02.09-speed-comparison-between-list-\u0026-tuple.ipynb)\n\t - [02.10 字典](02-python-essentials/02.10-dictionaries.ipynb)\n\t - [02.11 集合](02-python-essentials/02.11-sets.ipynb)\n\t - [02.12 不可变集合](02-python-essentials/02.12-frozen-sets.ipynb)\n\t - [02.13 Python 赋值机制](02-python-essentials/02.13-how-python-assignment-works.ipynb)\n\t - [02.14 判断语句](02-python-essentials/02.14-if-statement.ipynb)\n\t - [02.15 循环](02-python-essentials/02.15-loops.ipynb)\n\t - [02.16 列表推导式](02-python-essentials/02.16-list-comprehension.ipynb)\n\t - [02.17 函数](02-python-essentials/02.17-functions.ipynb)\n\t - [02.18 模块和包](02-python-essentials/02.18-modules-and-packages.ipynb)\n\t - [02.19 异常](02-python-essentials/02.19-exceptions.ipynb)\n\t - [02.20 警告](02-python-essentials/02.20-warnings.ipynb)\n\t - [02.21 文件读写](02-python-essentials/02.21-file-IO.ipynb)\n- [03. **Numpy**](03-numpy)\n\t - [03.01 Numpy 简介](03-numpy/03.01-numpy-overview.ipynb)\n\t - [03.02 Matplotlib 基础](03-numpy/03.02-matplotlib-basics.ipynb)\n\t - [03.03 Numpy 数组及其索引](03-numpy/03.03-numpy-arrays.ipynb)\n\t - [03.04 数组类型](03-numpy/03.04-array-types.ipynb)\n\t - [03.05 数组方法](03-numpy/03.05-array-calculation-method.ipynb)\n\t - [03.06 数组排序](03-numpy/03.06-sorting-numpy-arrays.ipynb)\n\t - [03.07 数组形状](03-numpy/03.07-array-shapes.ipynb)\n\t - [03.08 对角线](03-numpy/03.08-diagonals.ipynb)\n\t - [03.09 数组与字符串的转换](03-numpy/03.09-data-to-\u0026-from-string.ipynb)\n\t - [03.10 数组属性方法总结](03-numpy/03.10-array-attribute-\u0026-method-overview-.ipynb)\n\t - [03.11 生成数组的函数](03-numpy/03.11-array-creation-functions.ipynb)\n\t - [03.12 矩阵](03-numpy/03.12-matrix-object.ipynb)\n\t - [03.13 一般函数](03-numpy/03.13-general-functions.ipynb)\n\t - [03.14 向量化函数](03-numpy/03.14-vectorizing-functions.ipynb)\n\t - [03.15 二元运算](03-numpy/03.15-binary-operators.ipynb)\n\t - [03.16 ufunc 对象](03-numpy/03.16-universal-functions.ipynb)\n\t - [03.17 choose 函数实现条件筛选](03-numpy/03.17-choose.ipynb)\n\t - [03.18 数组广播机制](03-numpy/03.18-array-broadcasting.ipynb)\n\t - [03.19 数组读写](03-numpy/03.19-reading-and-writing-arrays.ipynb)\n\t - [03.20 结构化数组](03-numpy/03.20-structured-arrays.ipynb)\n\t - [03.21 记录数组](03-numpy/03.21-record-arrays.ipynb)\n\t - [03.22 内存映射](03-numpy/03.22-memory-maps.ipynb)\n\t - [03.23 从 Matlab 到 Numpy](03-numpy/03.23-from-matlab-to-numpy.ipynb)\n- [04. **Scipy**](04-scipy)\n\t - [04.01 SCIentific PYthon 简介](04-scipy/04.01-scienticfic-python-overview.ipynb)\n\t - [04.02 插值](04-scipy/04.02-interpolation-with-scipy.ipynb)\n\t - [04.03 概率统计方法](04-scipy/04.03-statistics-with-scipy.ipynb)\n\t - [04.04 曲线拟合](04-scipy/04.04-curve-fitting.ipynb)\n\t - [04.05 最小化函数](04-scipy/04.05-minimization-in-python.ipynb)\n\t - [04.06 积分](04-scipy/04.06-integration-in-python.ipynb)\n\t - [04.07 解微分方程](04-scipy/04.07-ODEs.ipynb)\n\t - [04.08 稀疏矩阵](04-scipy/04.08-sparse-matrix.ipynb)\n\t - [04.09 线性代数](04-scipy/04.09-linear-algbra.ipynb)\n\t - [04.10 稀疏矩阵的线性代数](04-scipy/04.10-sparse-linear-algebra.ipynb)\n- [05. **Python 进阶**](05-advanced-python)\n\t - [05.01 sys 模块简介](05-advanced-python/05.01-overview-of-the-sys-module.ipynb)\n\t - [05.02 与操作系统进行交互：os 模块](05-advanced-python/05.02-interacting-with-the-OS---os.ipynb)\n\t - [05.03 CSV 文件和 csv 模块](05-advanced-python/05.03-comma-separated-values.ipynb)\n\t - [05.04 正则表达式和 re 模块](05-advanced-python/05.04-regular-expression.ipynb)\n\t - [05.05 datetime 模块](05-advanced-python/05.05-datetime.ipynb)\n\t - [05.06 SQL 数据库](05-advanced-python/05.06-sql-databases.ipynb)\n\t - [05.07 对象关系映射](05-advanced-python/05.07-object-relational-mappers.ipynb)\n\t - [05.08 函数进阶：参数传递，高阶函数，lambda 匿名函数，global 变量，递归](05-advanced-python/05.08-functions.ipynb)\n\t - [05.09 迭代器](05-advanced-python/05.09-iterators.ipynb)\n\t - [05.10 生成器](05-advanced-python/05.10-generators.ipynb)\n\t - [05.11 with 语句和上下文管理器](05-advanced-python/05.11-context-managers-and-the-with-statement.ipynb)\n\t - [05.12 修饰符](05-advanced-python/05.12-decorators.ipynb)\n\t - [05.13 修饰符的使用](05-advanced-python/05.13-decorator-usage.ipynb)\n\t - [05.14 operator, functools, itertools, toolz, fn, funcy 模块](05-advanced-python/05.14-the-operator-functools-itertools-toolz-fn-funcy-module.ipynb)\n\t - [05.15 作用域](05-advanced-python/05.15-scope.ipynb)\n\t - [05.16 动态编译](05-advanced-python/05.16-dynamic-code-execution.ipynb)\n- [06. **Matplotlib**](06-matplotlib)\n\t - [06.01 Pyplot 教程](06-matplotlib/06.01-pyplot-tutorial.ipynb)\n\t - [06.02 使用 style 来配置 pyplot 风格](06-matplotlib/06.02-customizing-plots-with-style-sheets.ipynb)\n\t - [06.03 处理文本（基础）](06-matplotlib/06.03-working-with-text---basic.ipynb)\n\t - [06.04 处理文本（数学表达式）](06-matplotlib/06.04-working-with-text---math-expression.ipynb)\n\t - [06.05 图像基础](06-matplotlib/06.05-image-tutorial.ipynb)\n\t - [06.06 注释](06-matplotlib/06.06-annotating-axes.ipynb)\n\t - [06.07 标签](06-matplotlib/06.07-legend.ipynb)\n\t - [06.08 figures, subplots, axes 和 ticks 对象](06-matplotlib/06.08-figures,-subplots,-axes-and-ticks.ipynb)\n\t - [06.09 不要迷信默认设置](06-matplotlib/06.09-do-not-trust-the-defaults.ipynb)\n\t - [06.10 各种绘图实例](06-matplotlib/06.10-different-plots.ipynb)\n- [07. **使用其他语言进行扩展**](07-interfacing-with-other-languages)\n\t - [07.01 简介](07-interfacing-with-other-languages/07.01-introduction.ipynb)\n\t - [07.02 Python 扩展模块](07-interfacing-with-other-languages/07.02-python-extension-modules.ipynb)\n\t - [07.03 Cython：Cython 基础，将源代码转换成扩展模块](07-interfacing-with-other-languages/07.03-cython-part-1.ipynb)\n\t - [07.04 Cython：Cython 语法，调用其他C库](07-interfacing-with-other-languages/07.04-cython-part-2.ipynb)\n\t - [07.05 Cython：class 和 cdef class，使用 C++](07-interfacing-with-other-languages/07.05-cython-part-3.ipynb)\n\t - [07.06 Cython：Typed memoryviews](07-interfacing-with-other-languages/07.06-cython-part-4.ipynb)\n\t - [07.07 生成编译注释](07-interfacing-with-other-languages/07.07-profiling-with-annotations.ipynb)\n\t - [07.08 ctypes](07-interfacing-with-other-languages/07.08-ctypes.ipynb)\n- [08. **面向对象编程**](08-object-oriented-programming)\n\t - [08.01 简介](08-object-oriented-programming/08.01-oop-introduction.ipynb)\n\t - [08.02 使用 OOP 对森林火灾建模](08-object-oriented-programming/08.02-using-oop-model-a-forest-fire.ipynb)\n\t - [08.03 什么是对象？](08-object-oriented-programming/08.03-what-is-a-object.ipynb)\n\t - [08.04 定义 class](08-object-oriented-programming/08.04-writing-classes.ipynb)\n\t - [08.05 特殊方法](08-object-oriented-programming/08.05-special-method.ipynb)\n\t - [08.06 属性](08-object-oriented-programming/08.06-properties.ipynb)\n\t - [08.07 森林火灾模拟](08-object-oriented-programming/08.07-forest-fire-simulation.ipynb)\n\t - [08.08 继承](08-object-oriented-programming/08.08-inheritance.ipynb)\n\t - [08.09 super() 函数](08-object-oriented-programming/08.09-super.ipynb)\n\t - [08.10 重定义森林火灾模拟](08-object-oriented-programming/08.10-refactoring-the-forest-fire-simutation.ipynb)\n\t - [08.11 接口](08-object-oriented-programming/08.11-interfaces.ipynb)\n\t - [08.12 共有，私有和特殊方法和属性](08-object-oriented-programming/08.12-public-private-special-in-python.ipynb)\n\t - [08.13 多重继承](08-object-oriented-programming/08.13-multiple-inheritance.ipynb)\n- [09. **Theano 基础**](09-theano)\n\t - [09.01 Theano 简介及其安装](09-theano/09.01-introduction-and-installation.ipynb)\n\t - [09.02 Theano 基础](09-theano/09.02-theano-basics.ipynb)\n\t - [09.03 Theano 在 Windows 上的配置](09-theano/09.03-gpu-on-windows.ipynb)\n\t - [09.04 Theano 符号图结构](09-theano/09.04-graph-structures.ipynb)\n\t - [09.05 Theano 配置和编译模式](09-theano/09.05-configuration-settings-and-compiling-modes.ipynb)\n\t - [09.06 Theano 条件语句](09-theano/09.06-conditions-in-theano.ipynb)\n\t - [09.07 Theano 循环：scan（详解）](09-theano/09.07-loop-with-scan.ipynb)\n\t - [09.08 Theano 实例：线性回归](09-theano/09.08-linear-regression.ipynb)\n\t - [09.09 Theano 实例：Logistic 回归](09-theano/09.09-logistic-regression-.ipynb)\n\t - [09.10 Theano 实例：Softmax 回归](09-theano/09.10-softmax-on-mnist.ipynb)\n\t - [09.11 Theano 实例：人工神经网络](09-theano/09.11-net-on-mnist.ipynb)\n\t - [09.12 Theano 随机数流变量](09-theano/09.12-random-streams.ipynb)\n\t - [09.13 Theano 实例：更复杂的网络](09-theano/09.13-modern-net-on-mnist.ipynb)\n\t - [09.14 Theano 实例：卷积神经网络](09-theano/09.14-convolutional-net-on-mnist.ipynb)\n\t - [09.15 Theano tensor 模块：基础](09-theano/09.15-tensor-basics.ipynb)\n\t - [09.16 Theano tensor 模块：索引](09-theano/09.16-tensor-indexing.ipynb)\n\t - [09.17 Theano tensor 模块：操作符和逐元素操作](09-theano/09.17-tensor-operator-and-elementwise-operations.ipynb)\n\t - [09.18 Theano tensor 模块：nnet 子模块](09-theano/09.18-tensor-nnet-.ipynb)\n\t - [09.19 Theano tensor 模块：conv 子模块](09-theano/09.19-tensor-conv.ipynb)\n- [10. **有趣的第三方模块**](10-something-interesting)\n\t - [10.01 使用 basemap 画地图](10-something-interesting/10.01-maps-using-basemap.ipynb)\n\t - [10.02 使用 cartopy 画地图](10-something-interesting/10.02-maps-using-cartopy.ipynb)\n\t - [10.03 探索 NBA 数据](10-something-interesting/10.03-nba-data.ipynb)\n\t - [10.04 金庸的武侠世界](10-something-interesting/10.04-louis-cha's-kungfu-world.ipynb)\n- [11. **有用的工具**](11-useful-tools)\n\t - [11.01 pprint 模块：打印 Python 对象](11-useful-tools/11.01-pprint.ipynb)\n\t - [11.02 pickle, cPickle 模块：序列化 Python 对象](11-useful-tools/11.02-pickle-and-cPickle.ipynb)\n\t - [11.03 json 模块：处理 JSON 数据](11-useful-tools/11.03-json.ipynb)\n\t - [11.04 glob 模块：文件模式匹配](11-useful-tools/11.04-glob.ipynb)\n\t - [11.05 shutil 模块：高级文件操作](11-useful-tools/11.05-shutil.ipynb)\n\t - [11.06 gzip, zipfile, tarfile 模块：处理压缩文件](11-useful-tools/11.06-gzip,-zipfile,-tarfile.ipynb)\n\t - [11.07 logging 模块：记录日志](11-useful-tools/11.07-logging.ipynb)\n\t - [11.08 string 模块：字符串处理](11-useful-tools/11.08-string.ipynb)\n\t - [11.09 collections 模块：更多数据结构](11-useful-tools/11.09-collections.ipynb)\n\t - [11.10 requests 模块：HTTP for Human](11-useful-tools/11.10-requests.ipynb)\n- [12. **Pandas**](12-pandas)\n\t - [12.01 十分钟上手 Pandas](12-pandas/12.01-ten-minutes-to-pandas.ipynb)\n\t - [12.02 一维数据结构：Series](12-pandas/12.02-series-in-pandas.ipynb)\n\t - [12.03 二维数据结构：DataFrame](12-pandas/12.03-dataframe-in-pandas.ipynb)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flijin-thu%2Fnotes-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flijin-thu%2Fnotes-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flijin-thu%2Fnotes-python/lists"}