[SciPy-User] problem with loading large MAT files

Mohammad Abdollahi m.abdollahi at gmail.com
Mon Feb 21 04:50:25 EST 2011


Dear List

I have a couple of MAT files around 450 MB of size that apparently they are too large for scipy.io.loadmat function. In deed I keep getting this error : 

  File "/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/scipy/io/matlab/mio.py", line 140, in loadmat
    matfile_dict = MR.get_variables()
  File "/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/scipy/io/matlab/mio5.py", line 404, in get_variables
    hdr, next_position = self.read_var_header()
  File "/Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/scipy/io/matlab/mio5.py", line 356, in read_var_header
    stream = StringIO(dcor.decompress(data))
SystemError: Objects/stringobject.c:4271: bad argument to internal function


but everything is fine when I use a file with a size around 360 MB o sth. So does anybody know how to fix this ? of course without having to subdivide the original MAT file into samller parts.

Best
Mohammad


More information about the SciPy-User mailing list