python - Numpy fromfile io.UnsupportedOperation
问题描述
当我尝试使用 读取二进制文件numpy.fromfile
时,我收到一条错误消息io.UnsupportedOperation: seek
我在用Python 3.7.1
with open(filename, 'rb') as fin:
prolog = np.fromfile(fin, dtype=np.int32, count=15)
解决方案
这更简单,绝对应该有效:
prolog = np.fromfile(filename, dtype=np.int32, count=15)
推荐阅读
- performance - 为什么这个表达式解析器在(一些?)规则的数量上如此糟糕?
- php - Laravel 8 Auth 中间件保护路由失败
- scala - Spark - Scala:“错误:未找到:值转换”
- amazon-web-services - 在 SNS Terraform 脚本中定义 SQS 端点
- c++ - 错误:对非类类型“unsigned int”的成员的请求
- bash - 从 CSV 文件在 yaml 中生成模板
- c# - C++ 到 C# ReadProcessMemory
- java - 测试整数是否可以创建三角形
- haskell - 为什么这个定点计算不停止?
- python - str.replace() 不能将零点 (0.) 替换为零点零 (0.0)