2
$\begingroup$

I have EEG data with 5 columns (1 per each electrode) and I need to denoise it and extract features from it using Python. I tried to find relevant packages but my search kept leading me to MNE which takes as input data in a format that I don't have. My data is in a pandas dataframe.

my questions are:

  1. How do you denoise such dataset?
  2. How do you do feature extraction for it?

Thanks :)

$\endgroup$
  • 1
    $\begingroup$ Are you asking for a different python package, or a reference for how to do these, or a general explanation? If it's the last two, then you don't need the word "Python" in the title. $\endgroup$ – uhoh Feb 24 at 4:24
  • 1
    $\begingroup$ If you are looking for a python-based EEG analyzing toolbox, have you tried PyEEG (pyeeg.sourceforge.net)? $\endgroup$ – Cloudy Feb 25 at 12:49
  • $\begingroup$ I recommend updating the Q based on the comments, as the Q is vague; do you need Python script or general help? If the latter, the question is too broad to begin with. $\endgroup$ – AliceD Feb 26 at 19:45
  • $\begingroup$ Wow this is so exciting topic $\endgroup$ – Always Confused Sep 10 at 13:50
2
$\begingroup$

you can convert your data frame to numpy array using

data=df.to_numpy()

If your data is single trial meanining two dimensional dataset, you can use

channel_names=df.columns.tolist()
channel_types=len(channel_names)*['eeg']
sfreq = 1000  # in Hertz
montage = 'standard_1005'
info = mne.create_info(channel_names, sfreq, channel_types, montage)
raw = mne.io.RawArray(data, info)

If you have multitrials dataset

channel_names=df.columns.tolist()
channel_types=len(channel_names)*['eeg']
sfreq = 1000  # in Hertz
montage = 'standard_1005'
info = mne.create_info(channel_names, sfreq, channel_types, montage)
data=data.reshape(len(channel_names),-1,sfreq*time)
data=np.swapaxes(data,0,1)
epochs = mne.EpochsArray(sub, info)

Once you convert your dataset to mne structure, you can use mne filters and mne features

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.