[SciPy-dev] ReST tutorial - where should it go?

Ariel Rokem arokem@berkeley....
Sat May 16 12:13:15 CDT 2009


Hi - you can also make scipy.io.loadmat behave just like you expected by
setting the optional parameter 'squeeze_me' to True.
I have found that to be a very useful thing to do when dealing with Matlab
variables with a lot of nested structs and cell arrays. Big fan of
'squeeze_me'

Cheers,

Ariel

2009/5/15 Stéfan van der Walt <stefan@sun.ac.za>

> 2009/5/15 Matthew Brett <matthew.brett@gmail.com>:
> > I sense some gentle South African teasing here, but I'm too tired to
> > understand, so I say:
> >
> > Great - glad I taught you something new about structs!
>
> Always so suspicious of the former colonies! :)
>
> But no, I was being serious: thanks for all your work on scipy.io and
> for writing the tutorial!
>
> I was surprised, because I thought the Octave structure:
>
> octave:2> s = struct('foo', 1, 'bar', 2)
> s =
> {
>  foo =  1
>  bar =  2
> }
>
> would be read in by SciPy to a variable x that could be accessed:
>
> x.foo and x.bar
>
> In the tutorial I saw that you had to use
>
> x[0, 0].foo and x[0, 0].bar
>
> instead, which didn't make sense to me, mainly because in the 3 years
> since I last used Octave I forgot that one could do:
>
> octave:4> s = struct('foo', {1, 2}, 'bar', {4, 5})
> s =
> {
>  foo =
>
>  (,
>    [1] =  1
>    [2] =  2
>  ,)
>
>  bar =
>
>  (,
>    [1] =  4
>    [2] =  5
>  ,)
>
> }
>
> In Octave you then see that
>
> octave:6> size(s)
> ans =
>
>   1   2
>
> octave:7> s(1, 1)
> ans =
> {
>  bar =  4
>  foo =  1
> }
>
> after which the way SciPy indexes the data makes a lot more sense!
>
> Enjoy the weekend!
> Stéfan
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
>



-- 
Ariel Rokem
Helen Wills Neuroscience Institute
University of California, Berkeley
http://argentum.ucbso.berkeley.edu/ariel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-dev/attachments/20090516/d627f35b/attachment.html 


More information about the Scipy-dev mailing list