Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

5
  • Hi sygi, thanks for the suggestion. However, I got error message as shown in the updated post. The only thing being different with yours is that I use pickle. Looks like it did not give me error during loading the data.
    – user785099
    Commented Nov 19, 2016 at 20:13
  • 1
    I have checked and it works on my system, with both pickle and cPickle and both python 2 and 3. Are you sure you have the same file (md5 b39289ebd4f8755817b1352c8488b486)?
    – sygi
    Commented Nov 19, 2016 at 20:27
  • It works, do not know why it had error message previously. Thanks a lot.
    – user785099
    Commented Nov 20, 2016 at 5:31
  • In my case it worked adding those imports import sys; import pickle; import gzip; and using pickle instead of cPickle – I'm using Python 3.6.7 on macOs Mojave Commented Aug 5, 2019 at 20:08
  • Great answer although I'd suggest using with open instead of f.close() so you don't have a memory leak.
    – runnerX
    Commented Sep 5, 2023 at 21:12