[英]How do I access data from Python files (.pkl, pickle)?
New here and figured this would be the perfect place to ask a quick question.新来的,并认为这将是提出快速问题的理想场所。
I've been struggling to access the data from this webpage: http://sidekick.epfl.ch/data我一直在努力从这个网页访问数据: http://sidekick.epfl.ch/data
I need to access the data for my thesis, but the "example.py" file that is supposed to run and explain how to use the data simply doesn't.我需要访问我的论文的数据,但是应该运行并解释如何使用数据的“example.py”文件根本没有。 I've also never encountered ".pkl" files in the past which is making things harder.
我过去也从未遇到过“.pkl”文件,这让事情变得更加困难。
I haven't had any problem with the npy files, but I'd love to get some help so I can run all the files and get a full picture of the data.我对 npy 文件没有任何问题,但我很想获得一些帮助,以便我可以运行所有文件并全面了解数据。 If anyone knows how, could you please explain the procedure to me?
如果有人知道怎么做,你能向我解释一下程序吗? I only have a basic understanding of the concepts.
我对这些概念只有基本的了解。
Thank you all very much for your help,非常感谢大家的帮助,
Marc马克
You can load pickle files as follows.您可以按如下方式加载泡菜文件。 Don't forget to add
"rb"
to the open
method, as you need to open the file in binary mode.不要忘记在
open
方法中添加"rb"
,因为您需要以二进制模式打开文件。
import pickle
with open(path, "rb") as f:
content = pickle.load(f)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.