假设我得到了以下形状为3x3x2的numpy数组: import numpy as npxy = np.array([[(x, y)for x in X] for y in Y]) 上面的数组xy如下所示: [[[0 0] [2 0]]
[1 1] [1 2]
[2 2]]] 如何将上面的数组重塑为下面
我有一个数组: [[1],[2],[3]], ] # I don't know how many [[1],[2],[3]] there will be (thebatch size)[ [[2], [2]],]np.reshape(x, (3, -1, 1))
[[1], [2]] [[2], [3]]<em
我对python非常陌生,我有一项任务要“重塑”.txt文件中的一些数据。我正在寻找一个算法来解决这个问题,我已经想好了如何到达我需要的数据,并丢弃我不需要的数据,但是我不知道如何“减少”数据的维数。到目前为止,我所做的是在数组中获取必要的数据,并将这些数组放在numpy数组中。data = np.array([station, depth, temperatur