【发布时间】:2020-12-16 08:50:10
【问题描述】:
我无法改变 numpy 数组的形状
dataset[i].shape # (1134, )
dataset[i] = dataset[i].reshape((18, 63))
ValueError: could not broadcast input array from shape (18,63) into shape (1134)
【问题讨论】:
-
重塑工作;问题是您不能将矩阵的一行设置为重新整形的 numpy 数组(这是您尝试使用
dataset[i] = ...做的事情)。