有人能给我解释一下%时间是怎么工作的吗? 我从一本书上得到这个,但每次我使用它,我都会出错。 语法错误:语法无效
path = '/home/foad/PythonBoken/flash/'
import numpy as np
from random import gauss
a = [gauss(1.5, 2) for i in range(100000)] #generation of normally distributed randoms
#Write this list above to disk for later retrieval
import pickle
pkl_file=open(path + 'data.pkl', 'w') #open file for writing. Existing file may be overwritten
%time pickle.dump(a, pkl_file)
目前没有回答
相关问题 更多 >
编程相关推荐