[Python] What is the significance of shape[0] in reshapping images in the following code:...

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

  1. Stack

    Stack Membro Participativo

    I need to reshape the mnist data to include a "1" for grayscale and the code below does this I believe. The original mnist data is in this shape: (60000, 28, 28). What is the significance of train_images.shape[0]. I understand that the 28 is length and the next 28 is width and the 1 is for one channel (grayscale) But what is the shape[0] for?

    train_images=train_images.reshape(train_images.shape[0], 28, 28,1).astype('float32')

    Continue reading...

Compartilhe esta Página