Concatenating empty array in Numpy

后端 未结 6 491
情歌与酒
情歌与酒 2021-01-30 16:04

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         


        
6条回答
  •  长发绾君心
    2021-01-30 16:39

    np.concatenate, np.hstack and np.vstack will do what you want. Note however that NumPy arrays are not suitable for use as dynamic arrays. Use Python lists for that purpose instead.

提交回复
热议问题