[SciPy-User] How to handle a scipy.io.loadmat - related bug: parts of the data inaccessible after loadmat

Propadovic Nenad npropadovic at gmail.com
Fri Feb 24 12:37:16 EST 2017


Hello Gregor,

Anyhow, the field names are accessible by
>
> y = scipy.io.loadmat("x.mat")
> y['CanData'][0, 0]['msg'].dtype.names
>
> ('RPDO2',)
>

Oh. I missed both the above and the below. :(

or
>
> y = scipy.io.loadmat("x.mat", squeeze_me=True)
> y['CanData']['msg'].item().dtype.names
>
>
These are the access methods I was looking for all the time. I guess before
I ask why .item() has to be used I guess I'll go rtfm some more :(


> I would not consider this as a bug, more a documentation issue, which is
> resolved by this discussion. You might add a comment on stack overflow with
> your findings.
>
> Gregor
>

Yes, I will.
Thank you!
 Nenad
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-user/attachments/20170224/737493ff/attachment.html>


More information about the SciPy-User mailing list