我想将两个numpy数组转换为一个包含两列的DataFrame
。
第一个numpy数组'images'的形状是102, 1024
。
第二个numpy数组'label'的形状是(1020, )
我的核心代码如下:
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数组转换成一个数据框的两列?