How do I make a grid of empty lists in numpy that 'accepts' appending?
问题 I am trying to use numpy.append but something goes wrong and it just doesn't make sence to me anymore. Can someone explain why I am getting an error? >>> np.array([[], [], []]).shape (3, 0) >>> a=[[], [], []] >>> a[1].append(3) >>> a [[], [3], []] >>> b=np.array(a) >>> b[0].append(3) array([[3], [3], []], dtype=object) This is all logical to me, yet when I try the following it stops working. >>> c=np.array((3,0),dtype=object) >>> c[0].append(3) AttributeError: 'int' object has no attribute