Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
这将是一个相当愚蠢的问题,尽管它很烦人。我有一个包含 800 个 ndarrays 的列表,每个 ndarrays 有 7680 个元素。如何将其转换为 <800,7680> 格式?
只需将其传递给np.array工厂函数即可。举个例子:
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)