Run a script quickly from second time onward


I have a python script that takes a lot of time to complete.
The line that takes most of the time is:

ndf['embeddings'] = ndf['embeddings'].apply(ast.literal_eval) 

Is there any way to pickle the results so that I will have to wait only for the first time?

>Solution :



should do just that

you can then load it with pandas.read_pickle("mydf.pkl")

Leave a Reply Cancel reply