我是python的新手,所以要腌制文件。当我遇到这个问题时,我一直在关于Udacity的机器学习课程。这是我的代码:
import pickle
enron_data = pickle.load(open(filename, "r"))
通过第5课我们必须从python中的.pkl文件加载Enron Dataset,但我不断收到以下错误:
as@LENOVO:~/Desktop/ud120-projects$ python datasets_questions/explore_enron_data.py
Traceback (most recent call last):
File "datasets_questions/explore_enron_data.py", line 20, in <module>
enron_data = pickle.load(open("/home/as/Desktop/ud120-projects/final_project/final_project_dataset.pkl", "r"))
File "/usr/lib/python2.7/pickle.py", line 1378, in load
return Unpickler(file).load()
File "/usr/lib/python2.7/pickle.py", line 858, in load
dispatch[key](self)
File "/usr/lib/python2.7/pickle.py", line 966, in load_string
raise ValueError, "insecure string pickle"