[Python] Interleaving two NumPy arrays efficiently

Discussão em 'Python' iniciado por Stack, Março 1, 2025.

  1. Stack

    Stack Membro Participativo

    Assume the following arrays are given:

    a = array([1, 3, 5])
    b = array([2, 4, 6])


    How would one interleave them efficiently so that one gets a third array like the following?

    c = array([1, 2, 3, 4, 5, 6])


    It can be assumed that length(a) == length(b).

    Continue reading...

Compartilhe esta Página