首页 > 解决方案 > 在python中将原始二进制数据转换为无符号整数

问题描述

我正在尝试在没有 API 的情况下读取 MNIST 数据。我从 http://yann.lecun.com/exdb/mnist/看到了格式。对于训练集标签文件,从 4 到 7 的字节应表示样本数,即 60000。

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

train.read(4)

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

我想把它转换成int,我是新来的,我能得到一些帮助吗?

标签: pythoncodecmnist

解决方案


推荐阅读