numpy array add dimension code example Example: how to extend the dimension for array in numpy an_array = np.array([[0, 1],[2, 3]])