[Python] Merge two arrays vertically to array of tuples using numpy

Discussão em 'Python' iniciado por Stack, Abril 16, 2025.

  1. Stack

    Stack Membro Participativo

    I have two numpy arrays:

    x = np.array([-1, 0, 1, 2])
    y = np.array([-2, -1, 0, 1])


    Is there a way to merge these arrays together like tuples:

    array = [(-1, -2), (0, -1), (1, 0), (2, 1)]

    Continue reading...

Compartilhe esta Página