[SciPy-dev] Please stress-test SVN version pf matlab reader

Eric Firing efiring at hawaii.edu
Sat Jan 9 14:49:21 EST 2010


Matthew Brett wrote:
> Hi
> 
>> further - if I set both squeeze_me and struct_as_record to True (does that
>> make sense?), I get into some rather nasty situations, where I can't use the
>> variables in the matfile:
> 
> Sorry - I think I missed your first email, and can't see the
> attachment - can you send by private mail?
> 
> I've fixed your first error I think - thanks for the report - please
> let me know if current SVN does work for mat_struct problem...
> 
> See you,
> 
> Matthew

Matthew,

I updated from svn, built, and installed, and I am having a similar 
problem.  A sample file is 
http://currents.soest.hawaii.edu/clivar/ladcp/I5S_2009/002.mat

Here is what happens:

In [16]:from scipy.io import loadmat

In [17]:a = loadmat('002.mat', struct_as_record=True, squeeze_me=True)

In [18]:a['p']['lon']
Out[18]:array(array(30.355230445182066), dtype=object)

n [20]:scipy.version.version
Out[20]:'0.8.0.dev6182'

I think this is the same problem that Ariel noted.  If I don't use 
squeeze_me but explicitly de-reference each of the two levels of arrays 
of shape (1,1), then I can get at the underlying variables.

Eric

> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev




More information about the SciPy-Dev mailing list