arr = np.array([1, 2, 3, 4, 5, 6]) # Reshape to 2x3 reshaped = arr.reshape(2, 3) print(reshaped) # [[1 2 3] # [4 5 6]] # Flatten back to 1D flat = reshaped.flatten() # [1 2 3 4 5 6]