Append a numpy.array to a certain numpy.array stored in a list
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have been for hours strugling to understand why i am not able to do this: >>> import numpy as np >>> a = [np.empty((0,78,3)) for i in range(2)] >>> b = np.random.randint(10,size=(1,78,3)) >>> a[0] = np.append(a[0],[b],axis=0) Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/site-packages/numpy/lib/function_base.py", line 5003, in append return concatenate((arr, values), axis=axis) ValueError: all the input arrays must have same number of dimensions >>> a is a list with s empty numpy