[Python] Making numpy array of positions

Discussão em 'Python' iniciado por Stack, Setembro 5, 2025.

  1. Stack

    Stack Membro Participativo

    Given a shape, how do I make a numpy array whose value at each position/location/index is the coordinates of that position/location/index?

    For example, if I had shape = (5,8,7) I want out_array where out_array[2,4,3] = [2,4,3], out_array[1,2,4] = [1,2,4], etc. In other words, how do I make an array of positions?

    Continue reading...

Compartilhe esta Página