首页 > 解决方案 > Numpy数组连接:ValueError:连接轴的所有输入数组维度必须完全匹配

问题描述

如何连接这些 NumPy 数组?

形状为 (3951, 400) 的第一个数组 形状为 (4939, 4) 的第二个数组

我试过np.concatenate((array1, array2), axis=1) 了,我尝试了另一个解决方案,比如这个问题 numpy array concatenate: "ValueError: all the input array must have the same number of dimensions"但我得到了这个错误

ValueError:连接轴的所有输入数组维度必须完全匹配,但沿维度 0,索引 0 处的数组大小为 3951,索引 1 处的数组大小为 4939

标签: pythonnumpy

解决方案


推荐阅读