import numpy as np north = np.array([[10, 11, 12], [13, 14, 15]]) south = np.array([[20, 21, 22]]) east = np.array([[30], [31]]) by_row = np.concatenate((north, south), axis=0) expected_by_row = np.array([[10, 11, 12], [13, 14, 15], [20, 21, 22]]) np.testing.assert_array_equal(by_row, expected_by_row) by_column = np.concatenate((north, east), axis=1) expected_by_column = np.array([[10, 11, 12, 30], [13, 14, 15, 31]]) np.testing.assert_array_equal(by_column, expected_by_column) print("north shape:", north.shape) print("south shape:", south.shape) print("east shape:", east.shape) print("by row:") for row in by_row: print(" ", row.tolist()) print("by row shape:", by_row.shape) print("by column:") for row in by_column: print(" ", row.tolist()) print("by column shape:", by_column.shape)