I have multiple pickle files which contain two lists. The first one is a lightweight list of floats, but the second one is a list of long vectors which consumes a lot of memory when loaded. How can I load only the first list from each pickle file? This is the way I currently do it:
import cPickle, bz2
with bz2.BZ2File(lhl_file, "rb") as pickled_file:
pickle_object = cPickle.load(pickled_file)
light_list, \
heavy_list = list(pickle_object)