摘要:
import numpy as np A = np.arange(12).reshape(3,4) print(A) print(np.split(A,2,axis=1)) print(np.split(A,3,axis=0)) #split不能进行不等分割 #print(np.split(A,3,axis=1)) print(np.array_split(A,3,axis=1)) #纵向分... 阅读全文
摘要:
import numpy as np A = np.array([1,1,1])[:,np.newaxis] B = np.array([2,2,2])[:,np.newaxis] #合并 C = np.vstack((A,B)) D = np.hstack((A,B)) #0,1纵横 E =np.concatenate((A,B,B,A),axis=0) print(E) print(C... 阅读全文