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.

Notes

Changed in version 0.15: Table values were changed from floats (with NaN for missing values) to Pandas nullable integer arrays.

Examples using mne_bids.stats.count_events#

02. Convert MNE sample data to BIDS format

02. Convert MNE sample data to BIDS format

04. Convert EEG data to BIDS format

04. Convert EEG data to BIDS format

05. BIDS conversion for group studies

05. BIDS conversion for group studies

13. Convert NIRS data to BIDS format

13. Convert NIRS data to BIDS format