我正在编写一个特征选择代码。基本上是从featureselection函数获取输出并将其与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 列表中我们有 [] 一样?