2
0

More than 3 years have passed since last update.

【Numpy】2つの一次元配列をおそらく最短で交互に合成する方法

Posted at
import numpy as np

a = [0, 1, 2, 3, 4] #一次元配列1
b = [5, 6, 7, 8, 9] #一次元配列2

c = np.c_[a, b].flat[:] #合成

print(c)
out
[0 5 1 6 2 7 3 8 4 9] #出力はndarrayです
2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0