• 2022-06-15
    实现将数组a=np.arange (10).reshape(2,-1)和数组b=np.repeat(1,10).reshape(2,-1)水平堆叠的代码。[br][/br]import numpy as np[br][/br]a=np.arange (10).reshape(2,-1)[br][/br]b=np.repeat(1,10).reshape(2,-1)[br][/br]array=
    A: np.hstack((a,b))
    B: np.vstack((a,b))
    C: np.stack((a,b))
    D: np.concatenate((a,b))