0

I have a numpy, saved as data.dat file in python 3+ . When I load it in python 2.7

import numpy as np
data = np.load("data.data")

it throws error as

---------------------------------------------------------------------------
IOError                                   Traceback (most recent call last)
<ipython-input-17-c9c3d37c74d4> in <module>()
      8 startTime = datetime.now()
      9 vocabulary =[]
---> 10 data =np.load("data.dat")

/usr/lib/python2.7/dist-packages/numpy/lib/npyio.pyc in load(file, mmap_mode)
    399             except:
    400                 raise IOError(
--> 401                     "Failed to interpret file %s as a pickle" % repr(file))
    402     finally:
    403         if own_fid:

IOError: Failed to interpret file 'data.dat' as a pickle

Is there any way to solve it ?

Rangooski
  • 825
  • 1
  • 11
  • 29
  • Possible duplicate of [Pickle incompatability of numpy arrays between Python 2 and 3](http://stackoverflow.com/questions/11305790/pickle-incompatability-of-numpy-arrays-between-python-2-and-3) – Morgan Thrapp Jun 29 '16 at 16:43
  • Well it doesn't say anything about the .dat file ? – Rangooski Jun 29 '16 at 16:48

0 Answers0