Professional Documents
Culture Documents
Stacking Arrays
Stacking Arrays
Description
Merge the three arrays provided to you to form a one 4x4 array.
Input:
Array 1: 3*3
[16, 6, 1]
[[5, 8, 4, 3]]
Output:
[[7 13 14 5]
[18 10 17 8]
[11 12 19 4]
[16 6 1 3]]
# Import NumPy
import numpy as np
# Fill the first three columns of the first three rows with values from the first
array
final_array[:3, :3] = np.array(list_1)
# Fill the last row with values from the second array
final_array[3, :3] = array_2
# Fill the last column with values from the third array
final_array[:3, 3] = array_3