advanced patterns with np.concatenate and axis parameter for 3D arrays in NumPy 1.24.0
I'm integrating two systems and Hey everyone, I'm running into an issue that's driving me crazy..... I'm stuck on something that should probably be simple. I'm currently working with 3D arrays in NumPy, and I've encountered an scenario when using `np.concatenate`. I have two arrays, both shaped (2, 3, 4), and I'm trying to concatenate them along the first axis. However, I'm getting an behavior that I'm not expecting. Here's the code I'm using: ```python import numpy as np array1 = np.random.rand(2, 3, 4) array2 = np.random.rand(2, 3, 4) result = np.concatenate((array1, array2), axis=0) print(result.shape) ``` When I run this, I receive the following behavior: ``` ValueError: all the input arrays must have the same number of dimensions ``` I double-checked, and both `array1` and `array2` are indeed 3D arrays. I also tried printing their shapes independently just before the concatenate call, and both output `(2, 3, 4)`. I even attempted to concatenate them along the second axis (axis=1) and the third axis (axis=2), but I keep running into similar issues. Could this be an scenario with how `np.concatenate` handles the axis parameter for 3D arrays in the version of NumPy I'm using (1.24.0)? Am I missing something in my approach, or is there a nuance with 3D concatenation that I need to be aware of? Any guidance would be greatly appreciated! I'm working on a service that needs to handle this. Any ideas what could be causing this? Am I missing something obvious? This is my first time working with Python latest. Any help would be greatly appreciated! Could someone point me to the right documentation? I'm on Linux using the latest version of Python. Thanks for taking the time to read this!