如何在 python 中将 (5858, ) 的形状更改为 (5858, n)

How to change shape of (5858, ) to (5858, n) in python

我想连接两个 numpy 文件,但它们的形状和样式不同。第一个文件“640_lbp.npy”由列表组成,而第二个文件 'train_x_test.npy' 由数组组成。

我得到一个形状为 (5858,) 的 numpy 文件,现在我想将其更改为 (5858, n),其中 n 代表每行的长度。我该怎么做。

enter image description here

enter image description here

那是行不通的。数组必须是矩形的,因此不能有不同的形状,具体取决于您所在的行。