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

Matthew Brett matthew.brett@gmail....
Thu Jan 14 06:58:05 CST 2010


Hi Mike,

On Tue, Jan 12, 2010 at 8:30 PM, M Trumpis <mtrumpis@berkeley.edu> wrote:
> Hi Matthew.. here's something I've been seeing which is confusing,
> concerning the dtypes. I'm sorry if anyone has pointed this out before
> related to record arrays. I haven't looked at it too closely myself
> yet
>
> In [13]: mri = sio.loadmat('mri.mat', struct_as_record=True)['mri']
>
> In [14]: affine = mri[0,0]['transform']
>
> In [15]: affine.dtype
> Out[15]: dtype('float64')
>
> In [16]: affine.dtype.isbuiltin
> Out[16]: 0

You mean, this last line?  That you were expecting:

In [16]: affine.dtype.isbuiltin
Out[16]: 1

?  Yes - that's odd.   It comes from this behaviour in numpy:

In [20]: dt = np.dtype('f8')

In [21]: dt.isbuiltin
Out[21]: 1

In [22]: ndt = dt.newbyteorder('<')

In [23]: ndt.isbuiltin
Out[23]: 0

and that looks a bit six-legged to me...  I'll post on the numpy list
for enlightenment.

Thanks for sharing...

Matthew


More information about the SciPy-Dev mailing list