How to plot MNIST image #3760
-
Hi, guys. How can I plot an mnist image in jupyter? It's a (1, 28, 28) tensor or a dataframe with 784 columns. Love the library, but I think it would really be beneficial to include an example of how to plot an MNIST (1, 28, 28) image. There are a lot of matplotlib/jupyter examples out there, and I think altair could make it much more pleasant. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Does something like this answer help you? https://stackoverflow.com/questions/60019006/can-we-plot-image-data-in-altair |
Beta Was this translation helpful? Give feedback.
-
Use flatten transforms and window transforms as the link mentioned:
reshape to the proper dimension:
|
Beta Was this translation helpful? Give feedback.
-
Thanks @ChiaLingWeng, its still a great example how you can make this work with multidimensional array data! Regarding this QA of Jake on SO:
I really hope elsewise so that we can use labeled (eg. xarray) or unlabeled (eg. numpy) multidimensional arrays as a native data source for Altair. Just like we have |
Beta Was this translation helpful? Give feedback.
Use flatten transforms and window transforms as the link mentioned:
reshape to the proper dimension: