import numpy a=numpy.arange(1,25).reshape(8,3) #對二維進行陣列轉置 b=numpy.transpose(a) c=a.transpose() d=a.T #print(d) print('對于三維a[i][j][k]進行轉置,默認的將i和k交換,j位置不變') #對三維陣列進行轉置 t=a.reshape(2,3,4) w=numpy.transpose(t) print(t) print(w) w1=numpy.transpose(t,(1,0,2)) #0,1,2值得是維度 #print(w1)
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/117813.html
標籤:Python
上一篇:07.DRF-序列化
下一篇:tick能見度
