[Python] Printing only a 2d part of a 3d array as a grid

Discussão em 'Python' iniciado por Stack, Maio 29, 2025.

  1. Stack

    Stack Membro Participativo

    I have a 3d storage array like this:

    M = np.array([[[3,3,3], [3,3,3], [3,3,3]], [[4,4,4], [4,4,4], [4,4,4]]])


    and I want to print just the first part of the array as a grid like this:

    3 3 3
    3 3 3
    3 3 3


    I already know how to print a 2d array in a grid, but do not know how I would print only that section.

    Continue reading...

Compartilhe esta Página