这将是一个相当愚蠢的问题,尽管它很烦人。我列出了800个ndarray,每个都有7680个元素。我如何得到这个< 800,7680>格式?
答案 0 :(得分:4)
将其传递给np.array
工厂函数。举个例子:
>>> lst = [np.zeros(7680) for x in range(800)] #just a list of 800 ndarrays ...
>>> arr = np.array(lst) #make them into an array
>>> arr.shape #shape looks OK to me :-)
(800, 7680)