我想將兩個numpy數組轉換爲一個包含兩列的DataFrame
。 第一個numpy數組'圖像'的形狀爲102, 1024
。 第二numpy的陣列「標籤」是形狀(1020,)
將兩個numpy數組轉換爲數據幀
我的核心代碼:
images=np.array(images)
label=np.array(label)
l=np.array([images,label])
dataset=pd.DataFrame(l)
但事實證明是一個錯誤,說:
ValueError: could not broadcast input array from shape (1020,1024) into shape (1020)
我應該怎麼辦在一個數據幀中將這兩個numpy數組轉換爲兩列?
的可能的複製的一維數組[組合NumPy數組](https://stackoverflow.com/questions/6740311/combining-numpy-arrays) – Grigoriy