首页 > 其他分享 >numpy中...和:的区别

numpy中...和:的区别

时间:2022-12-24 17:44:08浏览次数:56  
标签:... 区别 point ne print w1 np numpy

...代指多个:,:。 import numpy as np w1=[] for j in range(5):     if j!=0:         w1.append((j*1,j*1+1,0)) w1=np.array(w1) #print(w1) #print(w1[:,:-1]) e=w1[:,:-1] br=np.broadcast_to(e[None],(4,4,2)) #print(e[:,None,:]) #print(br) ne=e[:,None,:]-br ne=np.reshape(ne,(-1,1,2)) grid = np.arange(5, dtype=np.float32).reshape(1, -1, 1) point=grid*ne/10+ne.reshape((-1,1,2)) #print(point) x = point[..., 0].ravel()#x等于point[:,:,0].ravel。  

标签:...,区别,point,ne,print,w1,np,numpy
From: https://www.cnblogs.com/hahaah/p/17003095.html

相关文章