我想连接从磁盘加载的一组numpy数组。所有数组都有不同数量的列。Numpy连接到空阵列
这是我的代码
import numpy as np
FILE_LIST = ["matrix a", "matrix b"]
result=np.array([[0,0],[0,0]]) # I need to avoid this zero matrix
for fileName in FILE_LIST:
matrix = matrix= np.genfromtxt(fileName, delimiter=" ")
result = np.concatenate((result, matrix),axis=1)
print result
这里,我已经初始化结果与零数组作为我不能连接到一个空数组。我需要避免在结果的开头附加这个零数组。如何实现这一目标?
美丽...... !!!非常感谢你做的这些。 – Erdnase 2015-04-02 17:42:40