python - 在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,我是新来的,我能得到一些帮助吗?
解决方案
推荐阅读
- java - @ControllerAdvice 仅用于集中/全局异常处理或我们可以用它做的任何其他事情?
- html - Bootstrap 4 Navbar Toggle 不起作用(粘贴在下面的代码)
- c# - 运行同一表单的多个实例时出现问题
- php - 如何将数组的格式更改为集合作为laravel中的每个项目
- c++ - 如何使用 GCC 选项 -iprefix 和 -iwithprefix?
- javascript - ASP.net 使用 Eval 将逗号分隔的字符串作为参数传递
- javascript - 编写对象的静态数组
- javascript - 添加购物车中产品的总和
- abap - 异常 CX_SY_REF_IS_INITAL
- c# - 按下“播放”时,车轮网格在 y 轴上旋转,Unity