···141415151616def load_data(fnames, sfreq=128., replace_ch_names=None):
1717- """Load CSV files from the /data directory into a Raw object.
1818-1919- Args:
2020- fnames (array): CSV filepaths from which to load data
1717+ """Load CSV files from the /data directory into a RawArray object.
21182222- Keyword Args:
2323- sfreq (float): EEG sampling frequency
2424- replace_ch_names (dict or None): dictionary containing a mapping to
2525- rename channels. Useful when an external electrode was used.
1919+ Parameters
2020+ ----------
2121+ fnames : list
2222+ CSV filepaths from which to load data
2323+ sfreq : float
2424+ EEG sampling frequency
2525+ replace_ch_names : dict | None
2626+ A dict containing a mapping to rename channels.
2727+ Useful when an external electrode was used during recording.
26282727- Returns:
2828- (mne.io.array.array.RawArray): loaded EEG
2929+ Returns
3030+ -------
3131+ raw : an instance of mne.io.RawArray
3232+ The loaded data.
2933 """
30343135 raw = []
···9498 return evoked_topo
9599961009797-def plot_conditions(epochs, ch_ind=0, conditions=OrderedDict(), ci=97.5, n_boot=1000,
9898- title='', palette=None,
9999- diff_waveform=(4, 3)):
101101+def plot_conditions(epochs, ch_ind=0, conditions=OrderedDict(), ci=97.5,
102102+ n_boot=1000, title='', palette=None, diff_waveform=(4, 3)):
100103 """Plot Averaged Epochs with ERP conditions.
101104102102- Args:
103103- epochs (mne.epochs): EEG epochs
105105+ Parameters
106106+ ----------
107107+ epochs : an instance of mne.epochs
108108+ EEG epochs
109109+ conditions : an instance of OrderedDict
110110+ An ordered dictionary that contains the names of the
111111+ conditions to plot as keys, and the list of corresponding marker
112112+ numbers as value.
104113105105- Keyword Args:
106106- conditions (OrderedDict): dictionary that contains the names of the
107107- conditions to plot as keys, and the list of corresponding marker
108108- numbers as value. E.g.,
114114+ E.g.,
109115110110- conditions = {'Non-target': [0, 1],
111111- 'Target': [2, 3, 4]}
116116+ conditions = {'Non-target': [0, 1],
117117+ 'Target': [2, 3, 4]}
112118113113- ch_ind (int): index of channel to plot data from
114114- ci (float): confidence interval in range [0, 100]
115115- n_boot (int): number of bootstrap samples
116116- title (str): title of the figure
117117- palette (list): color palette to use for conditions
118118- ylim (tuple): (ymin, ymax)
119119- diff_waveform (tuple or None): tuple of ints indicating which
120120- conditions to subtract for producing the difference waveform.
119119+ ch_ind : int
120120+ An index of channel to plot data from.
121121+ ci : float
122122+ The confidence interval of the measurement within
123123+ the range [0, 100].
124124+ n_boot : int
125125+ Number of bootstrap samples.
126126+ title : str
127127+ Title of the figure.
128128+ palette : list
129129+ Color palette to use for conditions.
130130+ ylim : tuple
131131+ (ymin, ymax)
132132+ diff_waveform : tuple | None
133133+ tuple of ints indicating which conditions to subtract for
134134+ producing the difference waveform.
121135 If None, do not plot a difference waveform
122136123123- Returns:
124124- (matplotlib.figure.Figure): figure object
125125- (list of matplotlib.axes._subplots.AxesSubplot): list of axes
137137+ Returns
138138+ -------
139139+ fig : an instance of matplotlib.figure.Figure
140140+ A figure object.
141141+ ax : list of matplotlib.axes._subplots.AxesSubplot
142142+ A list of axes
126143 """
127144 if isinstance(conditions, dict):
128145 conditions = OrderedDict(conditions)
···172189 return fig, ax
173190174191def get_epochs_info(epochs):
175175- return [*[{x: len(epochs[x])} for x in epochs.event_id], {"Drop Percentage": round((1 - len(epochs.events)/len(epochs.drop_log)) * 100, 2)}, {"Total Epochs": len(epochs.events)}]
192192+ return [*[{x: len(epochs[x])} for x in epochs.event_id],
193193+ {"Drop Percentage": round((1 - len(epochs.events) /
194194+ len(epochs.drop_log)) * 100, 2)},
195195+ {"Total Epochs": len(epochs.events)}]