This may be an unusual thing to do, but I would like to load n items from a pckle file, it can be random, or first or last items.
The reason is that I am testing a neural network that load the pickle file as data and I want the network to run a lot faster (reducing from 100000 items to n) in the testing phase.
Right now I am loading the pickle as:
l = pickle.load(open(file, 'rb'))
Is there any parameter to load only the first n items?
The file looks like this: