目录
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)