Append a NumPy array to a NumPy array
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I have a numpy_array. Something like [ a b c ] . And then I want to append it into another NumPy array (just like we create a list of lists). How do we create an array of NumPy arrays containing NumPy arrays? I tried to do the following without any luck >>> M = np . array ([]) >>> M array ([], dtype = float64 ) >>> M . append ( a , axis = 0 ) Traceback ( most recent call last ): File " " , line 1 , in AttributeError : 'numpy.ndarray' object has no attribute 'append' >>> a array ([ 1 , 2 , 3 ]) 回答1: In [ 1 ]: import numpy as np In [