如何创建数组,其中每个元素都是python中的数组?

2024-05-13 20:29:24 发布

您现在位置:Python中文网/ 问答频道 /正文

我需要制作一个数组,其中每个元素都是一个数组。即,在数组的元素(3,4)中,有一个数组。本质上是数组的查找表。我怎样才能做到这一点。我试过:

for x in range(scanData.shape[0]):
    for y in range(scanData.shape[1]):
        responseArrayFull[x][y] = responseArray

但我收到了错误:

ValueError: could not broadcast input array from shape (41,60,19) into shape (1)

Tags: in元素for错误notrange数组could