数学函数

三角函数

sin (x,) [, out, where, casting, order, ...] )

三角正弦,元素方向。

cos (x,) [, out, where, casting, order, ...] )

余弦元素。

tan (x,) [, out, where, casting, order, ...] )

计算切线元素。

arcsin (x,) [, out, where, casting, order, ...] )

逆正弦,元素方向。

arccos (x,) [, out, where, casting, order, ...] )

三角反余弦,元素方向。

arctan (x,) [, out, where, casting, order, ...] )

三角反切线,元素方向。

hypot \(x1,x2,)/[, out, where, casting, ...] )

给定直角三角形的“腿”,返回其斜边。

arctan2 \(x1,x2,)/[, out, where, casting, ...] )

元素方向的弧正切 x1/x2 正确选择象限。

degrees (x,) [, out, where, casting, order, ...] )

将角度从弧度转换为度数。

radians (x,) [, out, where, casting, order, ...] )

将角度从度转换为弧度。

unwrap (P) [, discont, axis] )

通过将值之间的增量更改为2*pi补码来展开。

deg2rad (x,) [, out, where, casting, order, ...] )

将角度从度转换为弧度。

rad2deg (x,) [, out, where, casting, order, ...] )

将角度从弧度转换为度数。

双曲函数

sinh (x,) [, out, where, casting, order, ...] )

双曲正弦,元素方向。

cosh (x,) [, out, where, casting, order, ...] )

双曲余弦,元素方向。

tanh (x,) [, out, where, casting, order, ...] )

计算双曲正切元。

arcsinh (x,) [, out, where, casting, order, ...] )

逆双曲正弦元。

arccosh (x,) [, out, where, casting, order, ...] )

反双曲余弦,元素方向。

arctanh (x,) [, out, where, casting, order, ...] )

反双曲正切元。

舍入

around (a) [, decimals, out] )

平均四舍五入到给定的小数位数。

round_ (a) [, decimals, out] )

将数组舍入到给定的小数位数。

rint (x,) [, out, where, casting, order, ...] )

将数组元素舍入到最接近的整数。

fix (x) [, out] )

四舍五入到接近零的整数。

floor (x,) [, out, where, casting, order, ...] )

按元素返回输入的楼层。

ceil (x,) [, out, where, casting, order, ...] )

按元素返回输入的上限。

trunc (x,) [, out, where, casting, order, ...] )

按元素返回输入的截断值。

总额、产品、差额

prod (a) [, axis, dtype, out, keepdims, ...] )

返回数组元素在给定轴上的乘积。

sum (a) [, axis, dtype, out, keepdims, ...] )

给定轴上数组元素的总和。

nanprod (a) [, axis, dtype, out, keepdims] )

返回给定轴上数组元素的乘积,将非数字(NaN)视为一个。

nansum (a) [, axis, dtype, out, keepdims] )

返回给定轴上数组元素的和,将非数字(NaN)视为零。

cumprod (a) [, axis, dtype, out] )

返回元素沿给定轴的累积积。

cumsum (a) [, axis, dtype, out] )

返回元素沿给定轴的累积和。

nancumprod (a) [, axis, dtype, out] )

返回给定轴上数组元素的累积积,将非数字(NaN)视为一。

nancumsum (a) [, axis, dtype, out] )

返回给定轴上数组元素的累积和,将非数字(NaN)视为零。

diff (a) [, n, axis, prepend, append] )

计算沿给定轴的第n个离散差。

ediff1d [(A]) [, to_end, to_begin] )

数组中连续元素之间的差异。

gradient (f) * 瓦拉格斯[, axis, edge_order] )

返回n维数组的渐变。

cross (a,b) [, axisa, axisb, axisc, axis] )

返回两个(数组)向量的叉积。

trapz (Y) [, x, dx, axis] )

使用复合梯形规则沿给定轴积分。

指数和对数

exp (x,) [, out, where, casting, order, ...] )

计算输入数组中所有元素的指数。

expm1 (x,) [, out, where, casting, order, ...] )

计算 exp(x) - 1 用于数组中的所有元素。

exp2 (x,) [, out, where, casting, order, ...] )

计算 2**p 为了所有 p 在输入数组中。

log (x,) [, out, where, casting, order, ...] )

自然对数,按元素排序。

log10 (x,) [, out, where, casting, order, ...] )

返回以10为底的输入数组的对数,按元素排序。

log2 (x,) [, out, where, casting, order, ...] )

以2为底的对数 x .

log1p (x,) [, out, where, casting, order, ...] )

返回一的自然对数加上输入数组,按元素排序。

logaddexp \(x1,x2,)/[, out, where, casting, ...] )

输入的指数总和的对数。

logaddexp2 \(x1,x2,)/[, out, where, casting, ...] )

以2为底的输入的指数之和的对数。

其他特殊功能

i0 [(x)]

第一类修正贝塞尔函数,0阶。

sinc [(x)]

返回标准化的sinc函数。

浮点例程

signbit (x,) [, out, where, casting, order, ...] )

返回设置了signbit(小于零)的元素wise true。

copysign \(x1,x2,)/[, out, where, casting, ...] )

将x1的符号改为x2的符号,按元素排序。

frexp (x) [, out1, out2] \ [[, out, where, ...] )

将x元素分解为尾数和两个指数。

ldexp \(x1,x2,)/[, out, where, casting, ...] )

返回X1 * 2* *x2,元素方面。

nextafter \(x1,x2,)/[, out, where, casting, ...] )

返回x1之后的下一个浮点值,朝x2,元素方向。

spacing (x,) [, out, where, casting, order, ...] )

返回x和最近相邻数字之间的距离。

有理例行程序

lcm \(x1,x2,)/[, out, where, casting, order, ...] )

返回的最小公倍数 |x1||x2|

gcd \(x1,x2,)/[, out, where, casting, order, ...] )

返回的最大公约数 |x1||x2|

算术运算

add \(x1,x2,)/[, out, where, casting, order, ...] )

添加参数元素。

reciprocal (x,) [, out, where, casting, ...] )

返回参数的倒数,按元素排序。

positive (x,) [, out, where, casting, order, ...] )

数值正,元素方向。

negative (x,) [, out, where, casting, order, ...] )

数值负,元素方向。

multiply \(x1,x2,)/[, out, where, casting, ...] )

逐元素乘法参数。

divide \(x1,x2,)/[, out, where, casting, ...] )

返回输入的真除法,按元素排序。

power \(x1,x2,)/[, out, where, casting, ...] )

第一个数组元素从第二个数组提升为幂,按元素排序。

subtract \(x1,x2,)/[, out, where, casting, ...] )

减去参数,按元素排序。

true_divide \(x1,x2,)/[, out, where, ...] )

返回输入的真除法,按元素排序。

floor_divide \(x1,x2,)/[, out, where, ...] )

返回小于或等于输入除法的最大整数。

float_power \(x1,x2,)/[, out, where, ...] )

第一个数组元素从第二个数组提升为幂,按元素排序。

fmod \(x1,x2,)/[, out, where, casting, ...] )

返回按元素排序的除法余数。

mod \(x1,x2,)/[, out, where, casting, order, ...] )

返回按元素排序的除法余数。

modf (x) [, out1, out2] \ [[, out, where, ...] )

按元素返回数组的小数部分和整数部分。

remainder \(x1,x2,)/[, out, where, casting, ...] )

返回按元素排序的除法余数。

divmod (x1,x2) [, out1, out2] \ [[, out, ...] )

同时返回元素商和余数。

处理复数

angle (z) [, deg] )

返回复杂参数的角度。

real [(Val])

返回复杂参数的实部。

imag [(Val])

返回复变元的虚部。

conj (x,) [, out, where, casting, order, ...] )

返回复共轭,按元素排序。

conjugate (x,) [, out, where, casting, ...] )

返回复共轭,按元素排序。

其他

convolve (a,v) [, mode] )

返回两个一维序列的离散线性卷积。

clip \(A、A最小值、A最大值)[, out] )

裁剪(限制)数组中的值。

sqrt (x,) [, out, where, casting, order, ...] )

按元素返回数组的非负平方根。

cbrt (x,) [, out, where, casting, order, ...] )

按元素返回数组的多维数据集根。

square (x,) [, out, where, casting, order, ...] )

返回输入元素的平方。

absolute (x,) [, out, where, casting, order, ...] )

计算绝对值元素。

fabs (x,) [, out, where, casting, order, ...] )

计算绝对值元素。

sign (x,) [, out, where, casting, order, ...] )

返回按元素指示的数字符号。

heaviside \(x1,x2,)/[, out, where, casting, ...] )

计算重侧阶跃函数。

maximum \(x1,x2,)/[, out, where, casting, ...] )

数组元素的元素顺序最大值。

minimum \(x1,x2,)/[, out, where, casting, ...] )

数组元素的元素最小值。

fmax \(x1,x2,)/[, out, where, casting, ...] )

数组元素的元素顺序最大值。

fmin \(x1,x2,)/[, out, where, casting, ...] )

数组元素的元素最小值。

nan_to_num (x) [, copy, nan, posinf, neginf] )

将NaN替换为零,将无穷大替换为大的有限数(默认行为),或替换为用户使用 nanposinf 和/或 neginf 关键词。

real_if_close (a) [, tol] )

如果输入是复数,所有虚部都接近零,则返回实部。

interp \(X、XP、FP)[, left, right, period] )

单调递增样本点的一维线性插值。