概述
文章
- 基础篇
- 进阶篇
- 其他篇
用户指南
NumPy 参考手册
- 数组对象
- 常量
- 通函数(ufunc)
- 常用 API
- 创建数组
- 数组处理程序
- 二进制运算
- 字符串操作
- C-Types 外部函数接口(numpy.ctypeslib)
- 时间日期相关
- 数据类型相关
- 可选的 Scipy 加速支持(numpy.dual)
- 具有自动域的数学函数( numpy.emath)
- 浮点错误处理
- 离散傅立叶变换(numpy.fft)
- 财金相关
- 实用的功能
- 特殊的 NumPy 帮助功能
- 索引相关
- 输入和输出
- 线性代数(numpy.linalg)
- 逻辑函数
- 操作掩码数组
- 数学函数(Mathematical functions)
- 矩阵库 (numpy.matlib)
- 杂项(Miscellaneous routines)
- 填充数组(Padding Arrays)
- 多项式(Polynomials)
- 随机抽样 (numpy.random)
- 操作集合(Set routines)
- 排序,搜索和计数(Sorting, searching, and counting)
- Statistics
- Test Support (numpy.testing)
- Window functions
- 打包(numpy.distutils)
- NumPy Distutils 用户指南
- NumPy C-API
- NumPy 的内部
- NumPy 和 SWIG
其他文档
文章来源于网络收集而来,版权归原创者所有,如有侵权请及时联系!
数学函数(Mathematical functions)
三角函数
method | description |
---|---|
sinopen in new window(x, /[, out, where, casting, order, …]) | 正弦函数, element-wise. |
cosopen in new window(x, /[, out, where, casting, order, …]) | 余弦函数 element-wise. |
tanopen in new window(x, /[, out, where, casting, order, …]) | 正切函数, element-wise. |
arcsinopen in new window(x, /[, out, where, casting, order, …]) | 反正弦函数, element-wise. |
arccosopen in new window(x, /[, out, where, casting, order, …]) | 反余弦函数, element-wise. |
arctanopen in new window(x, /[, out, where, casting, order, …]) | 反正切函数, element-wise. |
hypotopen in new window(x1, x2, /[, out, where, casting, …]) | 传入直角三角形的“直角边”,返回其斜边。 |
arctan2open in new window(x1, x2, /[, out, where, casting, …]) | x1 / x2的 Element-wise 反正切线正确选择象限。 |
degreesopen in new window(x, /[, out, where, casting, order, …]) | 将角度从弧度open in new window转换为度。 |
radians(x, /[, out, where, casting, order, …]) | 将角度从度转换为弧度。 |
unwrapopen in new window(p[, discont, axis]) | 通过将值之间的增量更改为2 * pi来展开。 |
deg2radopen in new window(x, /[, out, where, casting, order, …]) | 将角度从度转换为弧度。 |
rad2degopen in new window(x, /[, out, where, casting, order, …]) | 将角度从弧度转换为度。 |
双曲函数
method | description |
---|---|
sinhopen in new window(x, /[, out, where, casting, order, …]) | 双曲正弦, element-wise. |
coshopen in new window(x, /[, out, where, casting, order, …]) | 双曲余弦, element-wise. |
tanhopen in new window(x, /[, out, where, casting, order, …]) | 计算双曲正切 element-wise. |
arcsinhopen in new window(x, /[, out, where, casting, order, …]) | 反双曲正弦 element-wise. |
arccoshopen in new window(x, /[, out, where, casting, order, …]) | 反双曲余弦, element-wise. |
arctanhopen in new window(x, /[, out, where, casting, order, …]) | 反双曲正切 element-wise. |
四舍五入
method | description |
---|---|
aroundopen in new window(a[, decimals, out]) | 平均舍入到给定的小数位数。 |
round_open in new window(a[, decimals, out]) | 将数组舍入到给定的小数位数。 |
rintopen in new window(x, /[, out, where, casting, order, …]) | 将数组的元素四舍五入到最接近的整数。 |
fixopen in new window(x[, out]) | 四舍五入为零。 |
flooropen in new window(x, /[, out, where, casting, order, …]) | 返回输入的底限, element-wise. |
ceilopen in new window(x, /[, out, where, casting, order, …]) | 返回输入的上限, element-wise. |
truncopen in new window(x, /[, out, where, casting, order, …]) | 返回输入的截断值, element-wise. |
加法函数, 乘法函数, 减法函数
method | description |
---|---|
prodopen in new window(a[, axis, dtype, out, keepdims, …]) | 返回给定轴上数组元素的乘积。 |
sumopen in new window(a[, axis, dtype, out, keepdims, …]) | 给定轴上的数组元素的总和。 |
nanprodopen in new window(a[, axis, dtype, out, keepdims]) | 返回数组元素在给定轴上的乘积,将非数字(NaNs)视为一个。 |
nansumopen in new window(a[, axis, dtype, out, keepdims]) | 返回给定轴上的数组元素的总和,将非数字(NaNs)视为零。 |
cumprodopen in new window(a[, axis, dtype, out]) | 返回沿给定轴的元素的累加乘积。 |
cumsumopen in new window(a[, axis, dtype, out]) | 返回沿给定轴的元素的累加和。 |
nancumprodopen in new window(a[, axis, dtype, out]) | 返回数组元素在给定轴上的累积乘积,将非数字(NaNs)视为一个。 |
nancumsumopen in new window(a[, axis, dtype, out]) | 返回在给定轴上将非数字(NaNs)视为零的数组元素的累积总和。 |
diffopen in new window(a[, n, axis, prepend, append]) | 计算沿给定轴的第n个离散差。 |
ediff1dopen in new window(ary[, to_end, to_begin]) | 数组的连续元素之间的差值。 |
gradientopen in new window(f, *varargs, **kwargs) | 返回N维数组的梯度。 |
crossopen in new window(a, b[, axisa, axisb, axisc, axis]) | 返回两个(数组)向量的叉积。 |
trapzopen in new window(y[, x, dx, axis]) | 使用复合梯形规则沿给定轴积分。 |
指数和对数
method | description |
---|---|
expopen in new window(x, /[, out, where, casting, order, …]) | 计算输入数组中所有元素的指数。 |
expm1open in new window(x, /[, out, where, casting, order, …]) | 为数组中的所有元素计算exp(x)-1。 |
exp2open in new window(x, /[, out, where, casting, order, …]) | 为输入数组中的所有p计算2 ** p。 |
logopen in new window(x, /[, out, where, casting, order, …]) | 自然对数, element-wise. |
log10open in new window(x, /[, out, where, casting, order, …]) | 返回输入数组的以10为底的对数, element-wise. |
log2open in new window(x, /[, out, where, casting, order, …]) | x的以2为底的对数。 |
log1popen in new window(x, /[, out, where, casting, order, …]) | 返回元素加一个输入数组的自然对数。 |
logaddexpopen in new window(x1, x2, /[, out, where, casting, …]) | 输入取幂之和的对数。 |
logaddexp2open in new window(x1, x2, /[, out, where, casting, …]) | 以2为底的输入的幂和的对数。 |
其他特殊函数
method | description |
---|---|
i0open in new window(x) | 第一种修改的Bessel函数,阶数为0。 |
sincopen in new window(x) | 返回sinc函数。 |
浮点例程
method | description |
---|---|
signbitopen in new window(x, /[, out, where, casting, order, …]) | 在设置了符号位(小于零)的情况下返回 element-wise True。 |
copysignopen in new window(x1, x2, /[, out, where, casting, …]) | 将x1的符号更改为x2的符号, element-wise. |
frexpopen in new window(x[, out1, out2], / [[, out, where, …]) | 将x的元素分解为尾数和二进制指数。 |
ldexpopen in new window(x1, x2, /[, out, where, casting, …]) | 返回x1 * 2 ** x2, element-wise. |
nextafteropen in new window(x1, x2, /[, out, where, casting, …]) | 向x2返回x1之后的下一个浮点值, element-wise. |
spacingopen in new window(x, /[, out, where, casting, order, …]) | 返回x与最近的相邻数字之间的距离。 |
理性例程
method | description |
---|---|
lcmopen in new window(x1, x2, /[, out, where, casting, order, …]) | 返回1和x2的最小公倍数 |
gcdopen in new window(x1, x2, /[, out, where, casting, order, …]) | 返回x1和x2的最大公约数 |
算术运算
method | description |
---|---|
addopen in new window(x1, x2, /[, out, where, casting, order, …]) | 按元素添加参数。 |
reciprocalopen in new window(x, /[, out, where, casting, …]) | 以元素为单位返回参数的倒数。 |
positiveopen in new window(x, /[, out, where, casting, order, …]) | 数值正, element-wise. |
negativeopen in new window(x, /[, out, where, casting, order, …]) | 数值负数, element-wise. |
multiplyopen in new window(x1, x2, /[, out, where, casting, …]) | 逐个乘以参数。 |
divideopen in new window(x1, x2, /[, out, where, casting, …]) | 返回输入的真实除法, element-wise. |
poweropen in new window(x1, x2, /[, out, where, casting, …]) | 第一阵列元素从第二阵列提升为幂, element-wise. |
subtractopen in new window(x1, x2, /[, out, where, casting, …]) | 逐个元素地减去参数。 |
true_divideopen in new window(x1, x2, /[, out, where, …]) | 返回输入的真实除法, element-wise. |
floor_divideopen in new window(x1, x2, /[, out, where, …]) | 返回小于或等于输入的除法的最大整数。 |
float_poweropen in new window(x1, x2, /[, out, where, …]) | 第一阵列元素从第二阵列提升为幂, element-wise. |
fmodopen in new window(x1, x2, /[, out, where, casting, …]) | 返回元素的除法 remainderopen in new window。 |
modopen in new window(x1, x2, /[, out, where, casting, order, …]) | 返回元素的除法余数。 |
modfopen in new window(x[, out1, out2], / [[, out, where, …]) | 返回数组的分数和整数部分, element-wise. |
remainder(x1, x2, /[, out, where, casting, …]) | 返回元素的除法余数。 |
divmodopen in new window(x1, x2[, out1, out2], / [[, out, …]) | 同时返回按元素商和余数。 |
处理复数
method | description |
---|---|
angleopen in new window(z[, deg]) | 返回复杂参数的角度。 |
realopen in new window(val) | 返回复杂参数的实部。 |
imagopen in new window(val) | 返回复杂参数的虚部。 |
conjopen in new window(x, /[, out, where, casting, order, …]) | 返回 complex conjugateopen in new window, element-wise. |
conjugateopen in new window(x, /[, out, where, casting, …]) | 返回复共轭, element-wise. |
杂项
method | description |
---|---|
convolveopen in new window(a, v[, mode]) | 返回两个一维序列的离散线性卷积。 |
clipopen in new window(a, a_min, a_max[, out]) | 裁剪(限制)数组中的值。 |
sqrtopen in new window(x, /[, out, where, casting, order, …]) | 返回数组的非负 平方open in new window根, element-wise. |
cbrtopen in new window(x, /[, out, where, casting, order, …]) | 返回数组的立方根, element-wise. |
squareopen in new window(x, /[, out, where, casting, order, …]) | 返回输入的元素方平方。 |
absoluteopen in new window(x, /[, out, where, casting, order, …]) | 计算绝对值 element-wise. |
fabsopen in new window(x, /[, out, where, casting, order, …]) | 计算绝对值 element-wise. |
signopen in new window(x, /[, out, where, casting, order, …]) | 返回数字符号的逐元素指示。 |
heavisideopen in new window(x1, x2, /[, out, where, casting, …]) | 计算Heaviside阶跃函数。 |
maximumopen in new window(x1, x2, /[, out, where, casting, …]) | 数组元素的逐元素最大值。 |
minimumopen in new window(x1, x2, /[, out, where, casting, …]) | 数组元素的按元素最小值。 |
fmaxopen in new window(x1, x2, /[, out, where, casting, …]) | 数组元素的逐元素最大值。 |
fminopen in new window(x1, x2, /[, out, where, casting, …]) | 数组元素的按元素最小值。 |
nan_to_numopen in new window(x[, copy, nan, posinf, neginf]) | 用较大的有限数字(默认行为)或使用用户定义的nan,posinf和/或neginf关键字定义的数字将NaN替换为零和无穷大。 |
real_if_closeopen in new window(a[, tol]) | 如果复杂输入接近实数,则返回复杂数组。 |
interpopen in new window(x, xp, fp[, left, right, period]) | 一维线性插值。 |
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论