Concatenating column vectors using numpy arrays

后端 未结 2 591
孤独总比滥情好
孤独总比滥情好 2020-12-08 15:34

I\'d like to concatenate \'column\' vectors using numpy arrays but because numpy sees all arrays as row vectors by default, np.hstack and np.concatenate

2条回答
  •  不思量自难忘°
    2020-12-08 15:48

    I tried the following. Hope this is good enough for what you are doing ?

    >>> np.vstack((a,b,c))
    array([[ 0,  1],
           [ 2,  1],
           [-1, -1]])
    >>> np.vstack((a,b,c)).T
    array([[ 0,  2, -1],
           [ 1,  1, -1]])
    

提交回复
热议问题