소스 뷰어
조회수 :   1
import numpy as np

a = np.arange(1, 25).reshape(2, 3, 4)
b = np.arange(1, 17).reshape(2, 2, 4)
c = np.concatenate( ( a, b ) , axis=1 )

print( "a = ", a, sep="\n" )
print( "-"*60  ) 
print( "a.shape = ", a.shape )
print( "-"*60  ) 

print( "b = ", b, sep="\n" )
print( "-"*60  ) 
print( "b.shape = ", b.shape )
print( "-"*60  ) 

print( "c = np.concatenate( ( a, b ), axis=1 )", c, sep="\n" )
print( "-"*60  ) 
print( "c.shape = ", c.shape )
print( "-"*60  ) 
a = 
[[[ 1  2  3  4]
  [ 5  6  7  8]
  [ 9 10 11 12]]

 [[13 14 15 16]
  [17 18 19 20]
  [21 22 23 24]]]
------------------------------------------------------------
a.shape =  (2, 3, 4)
------------------------------------------------------------
b = 
[[[ 1  2  3  4]
  [ 5  6  7  8]]

 [[ 9 10 11 12]
  [13 14 15 16]]]
------------------------------------------------------------
b.shape =  (2, 2, 4)
------------------------------------------------------------
c = np.concatenate( ( a, b ), axis=1 )
[[[ 1  2  3  4]
  [ 5  6  7  8]
  [ 9 10 11 12]
  [ 1  2  3  4]
  [ 5  6  7  8]]

 [[13 14 15 16]
  [17 18 19 20]
  [21 22 23 24]
  [ 9 10 11 12]
  [13 14 15 16]]]
------------------------------------------------------------
c.shape =  (2, 5, 4)
------------------------------------------------------------