How to create NumPy XY array from X and Y array (zip equivalent)
If you have two 1D arrays x and y of the same length n = x.shape[0] in Python, this is how you can create a shape (n, 2) array using numpy similar to the way Python’s zip does it with list objects:
numpy_xy_stack.py
xy = np.stack((x, y), axis=1)Check out similar posts by category:
Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow