我想連接從磁盤加載的一組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