SyntaxError: %time pickle.dump

588 views Asked by At

Can someone please explain to me how the %time works? I got this from a book but every time I use it, I get an error. SyntaxError: invalid syntax

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)
0

There are 0 answers