mne_bids.stats.count_events

mne_bids.stats.count_events(root_or_path, datatype='auto')[source]

Count events present in dataset.

Parameters
root_or_pathpath-like | mne_bids.BIDSPath

If str or Path it is the root folder of the BIDS dataset. If a BIDSPath is passed it allows to limit the count to a subject, a session or a run by only considering the event files that match this BIDSPath.

datatypestr

Type of the data recording. Can be meg, eeg, ieeg or auto. If auto and a mne_bids.BIDSPath isinstance is passed as root_or_path which has a datatype attribute set, then this data type will be used. Otherwise, only one data type should be present in the dataset to avoid any ambiguity.

Returns
countspandas.DataFrame

The pandas dataframe containing all the counts of trial_type in all matching events.tsv files.

Examples using mne_bids.stats.count_events