软件包与文档简介

Python 中的软件工程原理

Adam Spannbauer

Machine Learning Engineer at Eastman

软件包与 PyPi

PyPi 标志

Python 中的软件工程原理

pip 简介

PyPi pip 安装

Python 中的软件工程原理

pip 简介

PyPi pip 安装

Python 中的软件工程原理

使用 pip 安装 numpy

datacamp@server:~$ pip install numpy
Collecting numpy
    100% |████████████████████████████████| 24.5MB 44kB/s 
Installing collected packages: numpy
Successfully installed numpy-1.15.4
Python 中的软件工程原理

如何使用 numpy?

阅读文档

Python 中的软件工程原理

用 help() 阅读文档

help(numpy.busday_count)
busday_count(begindates, enddates)
    统计 `begindates` 与 `enddates` 之间的有效天数,
    不含 `enddates` 当天。

Parameters ---------- begindates : 计数起始日期。 enddates : 计数结束日期(不包含)。
Returns ------- out : 起始与结束日期之间的有效天数。
Examples -------- >>> # 2011 年的工作日数 ... np.busday_count('2011', '2012') 260
Python 中的软件工程原理

用 help() 阅读文档

import numpy as np
help(np)
    提供:
      1. 同质项数组对象
      2. 针对数组的高速数学运算
      3. 线性代数、傅里叶变换、随机数生成
help(42)
class int(object)
 |  int(x=0) -> integer
 |  int(x, base=10) -> integer
 |  
 |  将数字或字符串转为整数;无参数时返回 0。若 x 为数字,返回 x.__int__()。
 |  对浮点数,向零截断。
Python 中的软件工程原理

Vamos praticar

Python 中的软件工程原理

Preparing Video For Download...