Append a numpy.array to a certain numpy.array stored in a list

前端 未结 2 1499
滥情空心
滥情空心 2021-01-28 05:45

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条回答
  •  迷失自我
    2021-01-28 06:15

    Your're not appending b but [b]. That doesn't work.

    So in order to append b, use

    a[0] = np.append(a[0],b,axis=0)
    

提交回复
热议问题