Numpy
什么是Numpy?
关于axis
数组
创建数组
import numpy as np
a = np.array( # 创建一个1x3的一维数组
[1,2,3]
)
andarray对象的属性
ndarray.shape
ndarray.ndim
ndarray.size
ndarray.dtype
ndarray.itemsize
ndarray.real
ndarray.imag
ndarray的创建方法
nd.array()
np.asarray()
np.zeros(shape, dtype=float)
np.zeros_like()
np.empty((shape, dtype=float)
np.empty_like()
np.full(shape, fill_value, dtype=None,)
np.full_like()
np.eye()
np.identity()
np.random
np.arange(start,stop,step,dtype)
np.linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None, axis=0)
np.fromfunction(function, shape, **kwargs)
数据类型
数据类型
类型代码
说明
数组运算
数组与标量的算术运算
加法
减法
除法
星乘(*)与点乘(.)
拷贝
索引与切片
统计方法 ☆☆☆
amin(a[, axis, out, keepdims]
amax(a[, axis, out, keepdims])
nanmin(a[, axis, out, keepdims])
nanmax(a[, axis, out, keepdims])
median(a[, axis, out, overwrite_input, keepdims])
average(a[, axis, weights, returned])
mean(a[, axis, dtype, out, keepdims])
nanmean(a[, axis, dtype, out, keepdims])
std(a[, axis, dtype, out, ddof, keepdims])
nanstd(a[, axis, dtype, out, ddof, keepdims])
var(a[, axis, dtype, out, ddof, keepdims])
nanvar(a[, axis, dtype, out, ddof, keepdims])
形状变换
重塑
扁平化处理
数组合并
concatenate
vstack&row_stack
hstack
column_stack
dstack
数组拆分
split
hsplit、vsplit、dsplit
重复数组
repeat
tile
转置
通用函数☆☆☆
函数
说明
函数
说明
搜索和计数☆☆☆
搜索
argmax(a[, axis, out])
nanargmax(a[, axis])
argmin(a[, axis, out])
线性代数
diag(v, k=0)






最后更新于
这有帮助吗?
