我正在寫一個特徵選擇碼被附加。基本上得到從featureselection函數的輸出,並將其級聯到numpy的陣列數據空numpy的陣列向
data=np.zeros([1,4114]) # put feature length here
for i in range(1,N):
filename=splitpath+str(i)+'.tiff'
feature=featureselection(filename)
data=np.vstack((data, feature))
data=data[1:,:] # remove the first zeros row
然而,這不是一個健壯的實現,因爲我需要知道特徵長度(4114)預先。
是否有任何空numpy的陣列矩陣,就像在Python列表,我們有[]?