Numpy数组常用函数汇总(数学运算、三角函数、位运算、比较运算及其它)

本文详细介绍了各种数学运算和函数的使用,包括基本的算术运算如加、减、乘、除,高级数学函数如对数、指数、三角函数等,以及位操作和比较函数。此外,还涵盖了特殊函数用于测试数值属性。
一、数学运算
函数名 description 说明
add(x1, x2, [, out, where, casting, order, …]) Add arguments element-wise. 按元素添加参数。
subtract(x1, x2, [, out, where, casting, …]) Subtract arguments, element-wise. 从元素角度减去参数。
multiply(x1, x2, [, out, where, casting, …]) Multiply arguments element-wise. 将参数逐元素相乘。
matmul(x1, x2, [, out, casting, order, …]) Matrix product of two arrays. 两个数组的矩阵乘积。
divide(x1, x2, [, out, where, casting, …]) Returns a true division of the inputs, element-wise. 以元素为单位返回输入的真实除法。
logaddexp(x1, x2, [, out, where, casting, …]) Logarithm of the sum of exponentiations of the inputs. 输入取幂之和的对数。
logaddexp2(x1, x2, [, out, where, casting, …]) Logarithm of the sum of exponentiations of the inputs in base-2. 以2为底的输入的幂和的对数。
true_divide(x1, x2, [, out, where, …]) Returns a true division of the inputs, element-wise. 以元素为单位返回输入的真实除法。
floor_divide(x1, x2, [, out, where, …]) Return the largest integer smaller or equal to the division of the inputs. 返回小于或等于输入除法的最大整数。
negative(x, [, out, where, casting, order, …]) Numerical negative, element-wise. 数值为负数,逐元素。
positive(x, [, out, where, casting, order, …]) Numerical positive, element-wise. 数值正数,逐元素。
power(x1, x2, [, out, where, casting, …]) First array elements raised to powers from second array, element-wise. 第一个数组元素在元素方面从第二个数组提升为幂。
float_power(x1, x2, [, out, where, …]) First array elements raised to powers from second array, element-wise. 第一个数组元素在元素方面从第二个数组提升为幂。
remainder(x1, x2, [, out, where, casting, …]) Return element-wise remainder of division. 返回元素的除法余数。
mod(x1, x2, [, out, where, casting, order, …]) Return element-wise remainder of division. 返回元素的除法余数。
fmod(x1, x2, [, out, where, casting, …]) Return the element-wise remainder of division. 返回元素的除法余数。
divmod(x1, x2[, out1, out2], [, out, …]) Return element-wise quotient and remainder simultaneously. 同时返回元素商和余数。
absolute(x, [, out, where, casting, order, …]) Calculate the absolute value element-wise. 按元素计算绝对值。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

半个冯博士

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值