Solved by nivek in post #2 
              
              
                Based on your code, you should be able to get the first element by running this: 
print(next(iter(trainset)))

You may find the examples on this page helpful.