# MLDatasets MNIST Indexing

**URL:** https://discourse.julialang.org/t/mldatasets-mnist-indexing/99246
**Category:** General Usage
**Created:** [May 22, 2023, 7:07pm UTC](https://discourse.julialang.org/t/mldatasets-mnist-indexing/99246 "2023-05-22T19:07:49Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![donkeysaddle](https://avatars.discourse-cdn.com/v4/letter/d/3e96dc/32.png) [@donkeysaddle](https://discourse.julialang.org/u/donkeysaddle)
#### Post date: [May 22, 2023, 7:07pm UTC](https://discourse.julialang.org/t/mldatasets-mnist-indexing/99246/1 "2023-05-22T19:07:49Z")

</div>

Why is it that if I look at an image from the MNIST dataset in MLDatasets as a matrix the rows and columns are switched?

> using MLDatasets  
> using ImageShow
> 
> trainset= MNIST(:train)
> 
> A = trainset.features[:,:,1]

So A[13,2] would actually be the pixel corresponding the 2nd row and the 13th column when I view A as an image.
