[SciPy-User] empty array and loadmat

Simon Moré simon.more at univ-provence.fr
Wed Jan 26 08:21:04 EST 2011


Hi,

Matthew, 
Thank you for your efficient help !
The last svn version works great for me !

Regards,

Simon

Le mardi 25 janvier 2011 à 13:30 -0800, Matthew Brett a écrit :
> Hi,
> 
> On Tue, Jan 25, 2011 at 11:32 AM, Matthew Brett <matthew.brett at gmail.com> wrote:
> > On Tue, Jan 25, 2011 at 10:29 AM, Matthew Brett <matthew.brett at gmail.com> wrote:
> >> Hi,
> >>
> >>> I'm trying to open EEGlab files using loadmat. EEGLab is a matlab
> >>> toolbox processing continuous and event-related EEG, MEG and other
> >>> electrophysiological data.
> >>> But some of my fields in the EEGlab structure are empty and loadmat
> >>> fails.
> >>>
> >>> my error :
> >>>
> >>> In [6]: test = scipy.io.loadmat('EMG_all.set',appendmat=False)
> >>>
> >>> [...]
> >>> /usr/lib/python2.6/dist-packages/scipy/io/matlab/miobase.py in
> >>> chars_to_str(self, str_arr)
> >>>    336     def chars_to_str(self, str_arr):
> >>>    337         ''' Convert string array to string '''
> >>> --> 338         dt = np.dtype('U' + str(small_product(str_arr.shape)))
> >>>    339         return np.ndarray(shape=(),
> >>>    340                           dtype = dt,
> >>>
> >>> TypeError: data type not understood
> >>
> >> Thanks for the report, and the file, that's very helpful.  I'm getting
> >> a different error in the latest scipy dev version, but there's clearly
> >> a problem, I will try and look at it today.
> >
> > Boils down to:
> >
> > octave-3.2.3:59> load Downloads/EMG_all.set
> > octave-3.2.3:60> var = EEG.urevent(2).type;
> > octave-3.2.3:61> whos var
> > Variables in the current scope:
> >
> >  Attr Name        Size                     Bytes  Class
> >  ==== ====        ====                     =====  =====
> >       var         1x0                          0  char
> >
> > Total is 0 elements using 0 bytes
> >
> > octave-3.2.3:62> save one_by_zero_char.mat var -6
> 
> Fixed in svn revision r7087 I believe.  I added the file above as a test,
> 
> Matthew
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user

-- 
Simon MORÉ
Ingénieur d'étude au Laboratoire de Neurobiologie de la Cognition, 
Pole 3C, CNRS, UMR 6155, Marseille
simon.more at univ-provence.fr
04 13 55 09 38




More information about the SciPy-User mailing list