fitgrid.io module
User utilities for reading fitgrid Epochs
data files and previously
saved fitted grids.
- fitgrid.io.epochs_from_dataframe(dataframe, time, epoch_id, channels)[source]
Construct Epochs object from a Pandas DataFrame epochs table.
The DataFrame should contain columns with names defined by epoch_id and time as index columns.
- Parameters
dataframe (pandas DataFrame) – a pandas DataFrame object
time (str) – time column name
epoch_id (str) – epoch identifier column name
channels (list of str) – list of string channel names
- Returns
epochs – an Epochs object with the data
- Return type
- fitgrid.io.epochs_from_feather(filename, time, epoch_id, channels)[source]
Construct Epochs object from a Feather file containing an epochs table.
The file should contain columns with names defined by epoch_id and time.
- Parameters
filename (str) – Feather file name
time (str) – time column name
epoch_id (str) – epoch identifier column name
channels (list of str) – list of string channel names
- Returns
epochs – an Epochs object with the data
- Return type
- fitgrid.io.epochs_from_hdf(filename, key, time, epoch_id, channels)[source]
Construct Epochs object from an HDF5 file containing an epochs table.
The HDF5 file should contain columns with names defined by epoch_id and time either as index columns or as regular columns. This is added as a convenience, in general, input epochs tables should contain these columns in the index.
- Parameters
filename (str) – HDF5 file name
key (str) – group identifier for the dataset when HDF5 file contains more than one
time (str) – time column name
epoch_id (str) – epoch identifier column name
channels (list of str) – list of string channel names
- Returns
epochs – an Epochs object with the data
- Return type