I have two problems with loading data on python, both the scipts work properly but they need too much time to run and sometimes "Killed" is the result (with the first one).
I have a big zipped text file and I do something like this:
import gzip import cPickle as pickle f = gzip.open('filename.gz','r') tab={} for line in f: #fill tab with open("data_dict.pkl","wb") as g: pickle.dump(tab,g) f.close()I have to do some operations on the dictionary I created in the previous script
import cPickle as pickle with open("data_dict.pkl", "rb") as f: tab = pickle.load(f) f.close() #operations on tab (the dictionary)
Do you have other solutionsin mind? Maybe not the ones involving YAML or JSON...