浮云间
full应该是在数组中“复制”字符串的快速(错误)方式:In [84]: np.full(4, 'label') Out[84]: array(['label', 'label', 'label', 'label'], dtype='<U5')In [85]: alist = [] In [86]: labels = ['one','two','three'] In [87]: for i in range(3): ...: temp=np.full(3,labels[i]) ...: alist.append(temp) ...: In [88]: alist Out[88]: [array(['one', 'one', 'one'], dtype='<U3'), array(['two', 'two', 'two'], dtype='<U3'), array(['three', 'three', 'three'], dtype='<U5')]In [89]: np.array(alist) Out[89]: array([['one', 'one', 'one'], ['two', 'two', 'two'], ['three', 'three', 'three']], dtype='<U5')或列表理解:In [91]: np.array([np.full(3,l,'U7') for l in labels]) Out[91]: array([['one', 'one', 'one'], ['two', 'two', 'two'], ['three', 'three', 'three']], dtype='<U7')