np.concatenate optimization guide as expected with arrays of mixed dimensions
I'm trying to concatenate a list of NumPy arrays of different shapes using `np.concatenate`, but I'm working with an unexpected behavior. Specifically, I have a 2D array and a 1D array, and I want to concatenate them along axis 0. Here's the code I'm using: ```python import numpy as np a = np.array([[1, 2, 3], [4, 5, 6]]) # Shape (2, 3) b = np.array([7, 8, 9]) # Shape (3,) # Trying to concatenate along axis 0 result = np.concatenate((a, b), axis=0) ``` When I run this, I get the following behavior: ``` ValueError: all the input arrays must have same number of dimensions ``` It seems like `np.concatenate` is not handling the different array shapes as I expected. I've checked the documentation but I'm still confused about how to properly concatenate these arrays. What am I missing? Should I reshape one of the arrays before attempting to concatenate them? If so, how should I do that? Any advice on best practices here would be appreciated! I'm using NumPy version 1.24.3. My development environment is Ubuntu 22.04. What are your experiences with this?