Hi, everyone,
I am trying to load an EEGLAB dataset using mne.io.read_raw_eeglab(), but I got the error: buffer is too small for requested array.
Then I found How to solve the problem of TypeError · Issue #8226 · mne-tools/mne-python · GitHub and learned about the parameter uint16_codec
, but the problem still persists. Further investigation revealed that the error occurred at:
75 try:
76 read_mat = _import_pymatreader_funcs("EEGLAB I/O")
77 except RuntimeError: # pymatreader not installed
---> 78 eeg = loadmat(fname, squeeze_me=True, mat_dtype=False)
79 return _check_for_scipy_mat_struct(eeg)
80 else:
81 return read_mat(fname, uint16_codec=uint16_codec)
then searched for related issues of this function and found TypeError: buffer is too small for requested array when reading file with io.loadmat · Issue #5516 · scipy/scipy · GitHub.
In the end, I succeeded by passing uint16_codec
to loadmat
. So I want to know why the parameter uint16_codec
was not directly passed to loadmat, as it seems that pymatreader dependency is not installed when mne is installed.
Please excuse my non-native English and verbose expression.
Thanks for any help!