biopsykit.io.eeg module¶
I/O functions for files related to EEG processing.
- biopsykit.io.eeg.load_eeg_raw_muse(file_path, tz='Europe/Berlin')[source]¶
Load a csv file with raw EEG data recorded by the Muse headband.
- Parameters
- Returns
data (
DataFrame
) – dataframe with raw EEG datafs (float) – sampling rate
- Raises
ValidationError – if file specified by
file_path
does not contain the required timestamp column as well as the EEG channel columns- Return type
- class biopsykit.io.eeg.MuseDataset(data, tz=None)[source]¶
Bases:
object
Get new Dataset instance.
Note
Usually you shouldn’t use this init directly. Use the provided from_csv_file constructor to handle loading recorded Muse data from a CSV file.
- Parameters
data (
pandas.DataFrame
) – DataFrame containing the raw EEG data.tz (str, optional) – Timezone of the recording, if present or
None
if no timezone is available.
- SAMPLING_RATE_HZ = 250.0¶
- classmethod from_csv_file(file_path, tz=None)[source]¶
Load Muse data from a CSV file.
- Parameters
file_path (str or
pathlib.Path
) – Path to the CSV file.tz (str, optional) – Timezone of the recording, if present or
None
if no timezone is available.
- Returns
Dataset instance containing the loaded data.
- Return type
- property sampling_rate_hz¶
Return the sampling rate of the EEG data in Hz.
- data_as_df(index=None)[source]¶
Return all data as one combined
pandas.DataFrame
.- Parameters
index (str, optional) – Specify which index should be used for the dataset. The options are: * “time”: For the time in seconds since the first sample * “utc”: For the utc time stamp of each sample * “utc_datetime”: for a pandas DateTime index in UTC time * “local_datetime”: for a pandas DateTime index in the timezone set for the session * None: For a simple index (0…N)
- Returns
DataFrame containing the raw EEG data.
- Return type