np.tile
就像贴地砖一样,将一块相同的地砖(数组)在地上平铺多少次(横向、纵向)
np.https://blog.csdn.net/qq_28618765/article/details/78082438
stack():沿着新的轴加入一系列数组。
vstack():堆栈数组垂直顺序(行)
hstack():堆栈数组水平顺序(列)。
dstack():堆栈数组按顺序深入(沿第三维)。
concatenate():连接沿现有轴的数组序列。
vsplit():将数组分解成垂直的多个子数组的列表。
np.hypot(两个矩阵之间)计算欧氏距离
np.dot(a,b)
Dot product of two arrays. Specifically,
- If both `a` and `b` are 1-D arrays, it is inner product of vectors
(without complex conjugation). 都是一维,相当于向量内积
- If both `a` and `b` are 2-D arrays, it is matrix multiplication,
but using :func:`matmul` or ``a @ b`` is preferred.二维相当于矩阵相乘
np.random
rand(d0, d1, ..., dn) Random values in a given shape.
randn(d0, d1, ..., dn) Return a sample (or samples) from the “standard normal” distribution.
randint(low[, high, size, dtype]) Return random integers from low (inclusive) to high (exclusive).
random_integers(low[, high, size]) Random integers of type np.int between low and high, inclusive.
random_sample([size]) Return random floats in the half-open interval [0.0, 1.0).
random([size]) Return random floats in the half-open interval [0.0, 1.0).产生随机矩阵,如random.random([2,3])产生一个2x3维的随机数
ranf([size]) Return random floats in the half-open interval [0.0, 1.0).
sample([size]) Return random floats in the half-open interval [0.0, 1.0).
choice(a[, size, replace, p]) Generates a random sample from a given 1-D array
bytes(length) Return random bytes.
————————————————
版权声明:本文为CSDN博主「-柚子皮-」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/pipisorry/article/details/39508417
np.where(h>=0.5,1,0)#h>=0.5的地方为1,其他为0