np.meshgrid producing unexpected shapes with non-matching input arrays in NumPy 1.24.0
I'm working on a personal project and I'm trying to implement I'm working with an scenario with `np.meshgrid` where the shapes of the output arrays are not matching the expected dimensions based on my input arrays..... I have two 1D arrays: `x` and `y`, where `x` has a shape of `(4,)` and `y` has a shape of `(3,)`. When I call `np.meshgrid(x, y)`, I would expect the shapes of the resulting arrays to be `(3, 4)` and `(3, 4)`, respectively, to represent a grid of coordinates. Instead, I get arrays shaped `(4, 3)`, which is quite unexpected and leads to issues in subsequent calculations. Here's the code snippet I'm currently using: ```python import numpy as np x = np.array([1, 2, 3, 4]) # Shape (4,) y = np.array([5, 6, 7]) # Shape (3,) X, Y = np.meshgrid(x, y) print('X shape:', X.shape) # Expected (3, 4) but got (4, 3) print('Y shape:', Y.shape) # Expected (3, 4) but got (4, 3) ``` I also tried using the `indexing` parameter as follows: ```python X, Y = np.meshgrid(x, y, indexing='ij') ``` but this didn't seem to resolve my scenario. I read through the [documentation](https://numpy.org/doc/stable/reference/generated/numpy.meshgrid.html) and I think I'm using it correctly. Is there a specific behavior for how `np.meshgrid` interprets the input arrays that I might be missing? I would appreciate any insights on how to get it to produce the expected shapes based on the input dimensions. The stack includes Python and several other technologies. Thanks in advance! I'm using Python latest in this project. I'm working with Python in a Docker container on Windows 11.