Let's say I have the following three lists:
calc_points=np.asarray(
[ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 39, 41, 43, 45, 47,
49, 51, 53, 55, 57, 59, 61, 63, 65, 67, 69, 71, 73, 75, 77, 79, 81,
83, 85, 87, 89, 91, 93, 95, 97, 99])
out=[c+1 for c in calc_points]
inout=[c+3 for c in calc_points]
and I would like to join them in a matrix where the first column is calc_points then inout followed by out then again inout and out. So the the first column is there only once, while the other two repeat 5 times.
I tried like this:
temp=[np.c_[calc_points,inout,out] for i in range(5)]
But it doesn't work as imagined. Instead of
calc_point | inout | out | inout | out ....
it produces
calc_point | inout | out
calc_point | inout | out
in/outall just add a value topoints, you don't even need concatenate. Just use an 'outer' addition:points[:,None] + np.array(([0]+[1,3]*5))