提问人:Pamela Reyes Ortega 提问时间:3/17/2023 最后编辑:snakecharmerbPamela Reyes Ortega 更新时间:3/17/2023 访问量:27
Python 读取无符号 16 位整数的二进制文件(见数据)
Python read binary file of unsigned 16 bit integers (see data)
问:
我必须在 Python 中读取二进制文件。我使用以下代码:
import struct
import numpy as np
fileName = "continuous.dat"
with open(fileName, mode='rb') as file:
fileContent = file.read()
a = struct.unpack("H" * ((len(fileContent)) // 2), fileContent)
print(a)
但是 print(a) 显示数据的无序列表,正如我在表格形式中看到的那样。
我想得到应该得到的 16 个频道的表。
文件是:https://drive.google.com/drive/folders/1R84CxTU1VgrBhMN3KFl63pO_Ml6VScDV?usp=share_link
print(a) 显示数据的无序列表,正如我在表格形式中看到的那样。
我想得到应该得到的 16 个频道的表。
文件是:https://drive.google.com/drive/folders/1R84CxTU1VgrBhMN3KFl63pO_Ml6VScDV?usp=share_link
答: 暂无答案
评论