for ループ内に可変サイズの 1 次元配列があり、これらの配列をサイズ 40x4000 の 2 次元配列の行に配置しています。最終的なサイズが 1x4000 になり、2 次元配列に収まるように、1 次元配列の最後にゼロを追加するにはどうすればよいですか?
例えば。
size of 1-D: 3700 , so add 300 zeros at the end
size of 1-D: 3800 , so add 200 zeros at the end
for i in range(n)
s = func(i) #returns row vector
# what to do here?
two_dim[i] = s
編集:これらはnumpy配列であり、リストではありません