mne-python icon indicating copy to clipboard operation
mne-python copied to clipboard

EEGLAB file export data type issue

Open arnodelorme opened this issue 1 year ago • 1 comments

Reading a file exported by MNE on MATLAB

EEG.trials

ans =

  int64

   105

The type is int64 instead of double. This can cause all kinds of problems (I was trying to use the number of trials to calculate a ratio, and it was always returning the wrong value for example). This might be the case as well for other fields.

arnodelorme avatar Aug 12 '22 17:08 arnodelorme

It could be argued that this is an issue with MATLAB. The number of trials is an integer number. Do integers need to be converted to floats when performing division etc.?

cbrnr avatar Aug 12 '22 18:08 cbrnr

As a heavy (mostly ex-)MATLAB user, I would say it's quite unexpected that anything numeric is not double in MATLAB. In this sense I am with @arnodelorme (and more than willing to defer to his expertise here!) that we should cast these to double. I'll reopen this in eeglabio, though, which is where this change would need to happen (cc @jackz314 )

larsoner avatar Oct 21 '22 14:10 larsoner