0
Q:

how to join two arrays in python

# concatenate 2 numpy arrays: row-wise
>np.concatenate((array2D_1, array2D_2))
 
array([[ 0,  1,  2],
       [ 3,  4,  5],
       [ 6,  7,  8],
       [10, 11, 12],
       [13, 14, 15],
       [16, 17, 18]])
0
# Python 3 code to demonstrate list 
# concatenation using + operator  
  
# Initializing lists 
test_list3 = [1, 4, 5, 6, 5] 
test_list4 = [3, 5, 7, 2, 5] 
  
# using + operator to concat 
test_list3 = test_list3 + test_list4 
  
# Printing concatenated list 
print ("Concatenated list using + : "
                   + str(test_list3)) 
0

New to Communities?

Join the community