可以理解为将第axis维进行拼接。前提是除axis维外,其他维度要相同才能拼接。
例如:
① a大小为(2,3,4),b大小为(3,3,4),则np.cpncatenate(axis=0)的结果大小为(2+3,3,4);
② a大小为(3,2,4),b大小为(3,3,4),则np.cpncatenate(axis=1)的结果大小为(3,2+3,4);
③ a大小为(2,5,2),b大小为(2,5,3),则np.cpncatenate(axis=2)的结果大小为(2,5,2+3)。’
代入具体的数值,举例如下:
① a=[[[1,2,3,4], [2,3,4,5], [3,4,5,6]], [[11,22,33,44], [22,33,44,55], [33,44,55,66]]], b=[[[2,3,4,5], [3,4,5,6], [4,5,6,7]], [[22,33,44,55], [33,44,55,66], [44,55,66,77]], [222,333,444,555], [333,444,555,666], [444,555,666,777]]],则np.concatenate((a,b), axis=0)=[[[1,2,3,4], [2,3,4,5], [3,4,5,6]], [[11,22,33,44], [22,33,44,55], [33,44,55,66]], [[2,3,4,5], [3,4,5,6], [4,5,6,7]], [[22,33,44,55], [33,44,55,66], [44,55,66,77]], [222,333,444,555], [333,444,555,666], [444,555,666,777]]]
② a=[[[1,2,3,4], [2,3,4,5]], [[11,22,33,44], [22,33,44,55]],