in Matlab I do this:
>> E = [];
>> A = [1 2 3 4 5; 10 20 30 40 50];
>> E = [E ; A]
E =
1 2 3 4 5
10 20 30 4
E = np.array([
]).reshape(0, 5)
print("E: \n{}\nShape {}\n".format(E, E.shape))
A = np.vstack([
[1, 2, 3, 4, 5],
[10, 20, 30, 40, 50]]
)
print("A:\n{}\nShape {}\n".format(A, A.shape))
C = np.r_[
E,
A
].astype(np.int32)
print("C:\n{}\nShape {}\n".format(C, C.shape))
E:
[]
Shape (0, 5)
A:
[[ 1 2 3 4 5]
[10 20 30 40 50]]
Shape (2, 5)
C:
[[ 1 2 3 4 5]
[10 20 30 40 50]]
Shape (2, 5)