0

I run a Python code in vscode. It takes a long time to process and run. After the processing is finished, I would like to get a graph which I did not think about before running the code. In other words, I want to do data processing after running a code. How can I do this? Thanks.

I searched and found a suggestion. I am not sure whether this is the best option or not.

import pickle
with open('training_history.pkl', 'wb') as f:
    pickle.dump(history, f)
with open('training_history.pkl', 'rb') as f:
    loaded_history = pickle.load(f)
6
  • 1
    How about putting the relevant data in a Database? Commented May 27, 2024 at 7:38
  • 2
    Even with pickling the data, you will still need to run the code at least once more to actually save it for later processing. Commented May 27, 2024 at 7:39
  • @SIGHUP there is no way to access all the processed data afterwards? post-processing is a must for some applications which you came up with the ideas later. Commented May 27, 2024 at 14:44
  • @matszwecja right. i am interested in that. i want to find a way to access the processed data (temporary data as well as the results). Commented May 27, 2024 at 14:45
  • 1
    if you want data processing then first you have to write data in file (txt, csv, excel), in database or eventually in pickle - all depends what data you have. Some data is better to keep in csv because you may process them in Excel or in other tools - not only in Python. But pickle you can use only in Python - and often it has to be the same version of Python, and it may need to import code with all structures which you wrote in pickle. Commented May 27, 2024 at 19:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.