NumPy: XY-Array aus X- und Y-Array erstellen (zip-Äquivalent)
Wenn du zwei 1D-Arrays x und y der gleichen Länge n = x.shape[0] in Python hast, kannst du wie folgt ein Array mit der Shape (n, 2) mit NumPy erstellen, ähnlich wie Pythons zip es mit list-Objekten macht:
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