Concatenation of 2 1D `numpy` Arrays Along 2nd Axis

前端 未结 5 1112
不知归路
不知归路 2021-02-18 22:59

Executing

import numpy as np
t1 = np.arange(1,10)
t2 = np.arange(11,20)

t3 = np.concatenate((t1,t2),axis=1)

results in a

Trac         


        
5条回答
  •  一个人的身影
    2021-02-18 23:16

    You better use a different function of Numpy called numpy.stack.
    It behaves like MATLAB's cat.

    The numpy.stack function doesn't require the arrays to have the dimension they are concatenated along.

提交回复
热议问题