<p><span style="padding: 3px 10px; border-radius: 5px; color: #ffffff; font-weight: bold; display: inline-block; background-color: #ff0000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;External Email - Use Caution&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></p><p></p><div dir="ltr">Hello All,<div><br></div><div>I am experiencing something strange with my data analysis code that worked few weeks ago but currently is failing on new data sets</div><div><br></div><div>Using the snippet below, i import a csv file containing eeg data  and events. Then i filtered the data, and epoch the data.</div><div>but when i call epoch.get_data(), instead of getting a 3D array of n-epochs by n_channel by_ time, i am getting only n_channel by n_times.  </div><div>I also see that all epochs are considered bad and dropped. </div><div>If this is the case, how can I avoid this?(dropping all epochs as bad.)</div><div><br></div><div>how can i go about resolving this?.</div><div><br></div><div>Looking forward to your reply</div><div><br></div><div><br></div><div><i>Code Snippet</i></div><div><i>#libraries imported</i></div><div><i>import numpy as np<br>import mne<br>import os<br>from mne.preprocessing import compute_proj_ecg, compute_proj_eog<br>from mne_features.feature_extraction import FeatureExtractor<br>import pandas as pd<br>from mne_features.feature_extraction import extract_features<br>from mne_features.univariate import compute_pow_freq_bands<br>from mne_features.utils import power_spectrum<br><br></i></div><div><i># Read the raw data from their respective CSV file as a NumPy array<br></i></div><div><i>data = np.loadtxt(&#39;eegdata.csv&#39;, delimiter=&#39;,&#39;) #reading the raw eeg signa<br>evenfile=np.loadtxt(&#39;eegevent.csv&#39;, delimiter=&#39;,&#39;)#reading the eeg event file with timestamps<br>evenfile=np.array(evenfile, dtype=&#39;int&#39;)#ensuring that the event file contains only int values and no float<br><br># Some information about the channels<br>channames = [&#39;Cz&#39;,&#39;Fz&#39;,&#39;C3&#39;,&#39;C4&#39;,&#39;F3&#39;,&#39;F4&#39;,&#39;P7&#39;,&#39;P8&#39;,&#39;stim&#39;] <br>ch_types = [&#39;eeg&#39;,&#39;eeg&#39;,&#39;eeg&#39;,&#39;eeg&#39;,&#39;eeg&#39;,&#39;eeg&#39;,&#39;eeg&#39;,&#39;eeg&#39;,&#39;stim&#39;]<br><br># Sampling rate of the Nautilus machine<br>sfreq = 250  # Hz for eeg<br><br></i></div><div><i># Create the info structure needed by MNE<br>info = mne.create_info(ch_names=channames, sfreq=sfreq, ch_types=ch_types)<br><br>#specify the events in the eeg data<br>event_id =1<br><br># Finally, create the Raw object<br>raw = mne.io.RawArray(data, info)<br><br></i></div><div><i>picks =mne.pick_types(<a href="http://raw.info" target="_blank">raw.info</a>, meg=False, eeg=True, stim=True, eog=False,exclude=&#39;bads&#39;)<br><br>#filtering the raw signal<br>raw=raw.filter(0.1, 120, fir_design=&#39;firwin&#39;)<br>raw=raw.notch_filter(np.arange(50, 125, 50), picks=picks, filter_length=&#39;auto&#39;,<br>                 phase=&#39;zero&#39;)<br># Read epochs<br>epochs = mne.Epochs(raw, evenfile, event_id=event_id, tmin=-2, tmax=2,  picks=picks)<br>labels = epochs.events[:, -1]<br><br>data = epochs.get_data()<br></i></div><div><br></div><div><br></div><div>Best Regards</div><div><div><div dir="ltr" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div style="font-size:12.8px"><span style="color:rgb(51,51,51);font-family:&quot;Droid Serif&quot;">A. Ighoyota ben</span></div><div style="font-size:12.8px"><span style="color:rgb(51,51,51);font-family:&quot;Droid Serif&quot;">Junior Researcher HCI (PhD in-view) </span></div><div style="font-size:12.8px"><span style="color:rgb(51,51,51);font-family:&quot;Droid Serif&quot;;font-size:12.8px">Tallinn University, Estonia</span><br></div><div style="font-size:12.8px"><span style="color:rgb(51,51,51);font-family:&quot;Droid Serif&quot;">School of digital Technologies.</span></div><div style="font-size:12.8px"><span style="color:rgb(51,51,51);font-family:&quot;Droid Serif&quot;">mobile:<a href="tel:+372%205832%206393" value="+37258326393" style="color:rgb(17,85,204)" target="_blank">+372582</a>78794</span></div><div style="font-size:12.8px"><span style="color:rgb(51,51,51);font-family:&quot;Droid Serif&quot;">skype: ighoyota-ben</span></div></div></div></div></div></div></div></div>