Issue
I'm trying to play around MNSIT dataset and here is the error I got in the very beginning. Error while fetching MNIST image
from sklearn.datasets import fetch_openml
mnist = fetch_openml('mnist_784')
x, y = mnist['data'], mnist['target']
digit = x[36001]
Solution
x
is 2-dimensional; try this:
digit = x[36001, :]
Since, you're facing an error, which must be due to x being not treated as a numpy array
, try the following two methods:
digit = x.iloc[36001, :]
Or
digit = x.to_numpy()[36001,:]
Answered By - Shivam Roy
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.