七、PYTHON 库文件---numpy库

目录

1.常见引入形式

2.创建数组函数

3.其他运算函数

4.矩阵运算函数

5.布尔运算与位运算函数

6.数组属性

7.傅里叶变换函数

8.三角运算函数

9.比较运算函数

10.算数运算函数

11.统计函数

12.形态操作函数

13.概率运算函数


1.常见引入形式

>>>import NumPy as np

2.创建数组函数

array([x, y,z], dtype=int)
arange (x, y,i) indices (n)
linspace(x, y, n)
random.rand (m, n)
function ((m, n),dtype)
ones ((m, n),dtype)
empty ((m, n), dtype)

3.其他运算函数

np.abs(×) 
np.sqrt(x)
np.squre(x)
np.sign(x)
np.ceil(x) 
np.floor(x)
np.rint (x[, out])
np.exp(x[, out])
np.log(x) 
np.log10(x)
np.log2(x)
np.log1p(x)

4.矩阵运算函数

np.mat(data, dtype)
np. bmat ([[A,B], [C, D]])
np.eye(n) 
np.dot(a,b)
np.corrcoef(a,b) 
np.cov(x)
np.transpose() 
ndarray.T
np.diagonal()
ndarray.H
np.trace()
ndarray.I

5.布尔运算与位运算函数

np.logical and (x1, x2[,out])
np.logical not (x[, out])
np.logical or (x1, x2[,out])
np.logical xor (x1, x2[,out])
np.bitwise and (x1, x2[,out])
np.bitwise not (x1,×2[,out])
np.bitwise or (x1,x2l, out])
np.bitwise xor (×1, x2[,out])

6.数组属性

ndarray.ndim
ndarray.shape
ndarray.size
ndarray.dtype
ndarray.itemsize
ndarray.data
ndarray.flat

7.傅里叶变换函数

fft(a[, n, axis])
ifft(a[, n, axis])
fft2(a[,s,axis,-1])
fftn(a[, s, axis])
hfft(a[,n, axis])

8.三角运算函数

np.sin(x)
np.cos(x)
np.tan(x)
np.aresin(x)
np.arccos(x)
np.aratan(x)
np.degree(x)
np.radians(x)

9.比较运算函数

np.equal(x1, X2 , y])
np.not_equal(x1, x2L, y])
np.less(x1, x2,[, y])
np.less_equal(x1, x2,[, y])
np.greater(xl, x2,l,y])
np.greater_equal (x1, x2,[, y])
np.where (condition [x, y])

10.算数运算函数

np.add(x1, x2[,y])
np.subtract(x1, x2[, y])
np.multiply(x1, x2[, y])
np.divide (x1, x2[, y])
np.true_divide (x1, x2 [, y)
np.floor_divide (x1, x2 [,y])
np.negative(x [,y])
np.power(x1,x2[,y])

11.统计函数

np.sum (x[, out])
np.mean (a, axis, dtype, out)
np.std (a, axis, dtype, out,ddof=0)
np.var (a, axis, dtype,out, ddof=0)
np.ndarray.min/max (axis, out)
np.argmin/argmax (a, axis, out)
cumsum (a,axis, dtype, out)
cumprod (a, axis, dtype, out)

12.形态操作函数

np.reshape (n,m)
np.flatten()
np.swapaxes()
np.resize(a, new_shape)

13.概率运算函数

np.random.normal(n,p,size)
np.random.lognormal (mean, sigma, N)
np.random.binomial (n,p,size)
np.random.hypergeometric(nl, n2,n, size)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

我Bu秃头

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

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

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

打赏作者

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

抵扣说明:

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

余额充值