我想知道如何使用“ pkl”和“ npz” python中的文件。我只能从他们那里得到str
我需要IMU数据集,所以我从以下 https://dip.is.tuebingen.mpg.de/
文件是“ pkl“或“ npz”。因此,我寻找如何将其加载到Python中。 但是,我只能看到一个包含一些“ str”贵重物品的“列表”。 我希望我会得到一些对象,但只有几个字符串,似乎也不是数据。
with np.load("imu_own_test.npz") as f:
file_list = f.files
for item in file_list:
print(type(item))
因此,我也尝试编码,因为“ str”似乎不是正确的字符类型。 但是,没有工作。 我只能看到这些字符。 “ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ x00 \ xfa〜j \ xbct \ x93 \ x93 \ x98? XBF \ XFC \ XA9 \ XF1 \ XD2MBP?B \ XCFF \ XD5 \ XE7J \ X“
with open('01.pkl', 'r') as source_file:
with open('02.csv', 'w+b') as dest_file:
contents = source_file.read()
dest_file.write(contents.encode('utf-16'))
我如何使用它?
I need IMU dataset, So I have downloaded it from the following
https://dip.is.tuebingen.mpg.de/
The files are either "pkl" or "npz". So I looked for how to load it in python.
however, I can see only a "list" that contained a few "str" valuables.
I expected I would get some objects but it had only a few strings, also can't seem to be data.
with np.load("imu_own_test.npz") as f:
file_list = f.files
for item in file_list:
print(type(item))
So I also tried encoding, because the "str" didn't seem to be the proper type of character.
But, didn't work.
I can see only these characters.
"x00\x00\x00\x00\x00\x00\xfa~j\xbct\x93\x98?B>\xe8\xd9\xac\xfa\xac\xbf\xb8\x1e\x85\xebQ\xb8\xae\xbf\xfc\xa9\xf1\xd2Mbp?B\xcff\xd5\xe7j\x"
with open('01.pkl', 'r') as source_file:
with open('02.csv', 'w+b') as dest_file:
contents = source_file.read()
dest_file.write(contents.encode('utf-16'))
How can I use it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论