【发布时间】:2021-04-15 02:00:51
【问题描述】:
我想将一个 numpy 数组附加到一个空的 numpy 数组,但它不起作用。
reconstructed = numpy.empty((4096,))
to_append = reconstruct(p, e_faces, weights, mu, i)
# to_append=array([129.47776809, 129.30775937, 128.90932868, ..., 103.64777681, 104.99912816, 105.93984307]) It's shape is (4096,)
numpy.append(reconstructed, to_append, axis=0)
#Axis is not working anyway.
请帮助我。我想把那个长数组放在空数组中。结果只是空的。
【问题讨论】:
-
不要尝试这样做。
empty和append不是列表克隆。 -
列出克隆是什么意思?
-
能不能把to_append列表的个数传过来或者举个例子?
-
您是否阅读过两者的文档?
-
# to_append=array([129.47776809, 129.30775937, 128.90932868, ..., 103.64777681, 104.99912816, 105.93984307]) 它的形状是 (4096,) 我已经写过了?