0

I am trying to read MNIST data without API. I have seen the format from http://yann.lecun.com/exdb/mnist/. For the training set label file, the bytes from 4 to 7 should indicate the number of samples i.e., 60000.

train = open('train-labels-idx1-ubyte','rb')

train.read(4)

bytecode = train.read(4) // this gives the bytecode. 

I want to convert that to int, I am new here, can I get some help?

Phoenix
  • 59
  • 7
  • If you need to convert Bytes to int in Python please check [this post](https://stackoverflow.com/questions/34009653/convert-bytes-to-int). – Davide Anghileri Nov 10 '20 at 14:55
  • If you need to convert Bytes to other numeric types, use the [struct](https://docs.python.org/3/library/struct.html) module – Aaron Nov 10 '20 at 17:14

0 Answers0