我有具有len(X)
等於13934和len(X[i])
的矩陣X,對於所有的i,等於74和我有一個數組Y,它具有len(Y)
等於13934和len(Y[i])
等於TypeError: object of type 'numpy.int64' has no len()
對於所有的i 。Python的垂直堆疊不工作
當我嘗試np.vstack((X,Y))
或result = np.concatenate((X, Y.T), axis=1)
我得到ValueError: all the input array dimensions except for the concatenation axis must match exactly
問題是什麼?當我打印出它說數組([1,...],dtype = int64),當我打印出X它說數組([數據..])沒有dtype。這可能是問題嗎?
我試圖通過做X.view('float32')
將它們都轉換爲float32,這沒有幫助。