bycycle.utils.epoch_df¶
- bycycle.utils.epoch_df(df_features, sig_len, epoch_len)[source]¶
Reshape a dataframe into a list of dataframes.
- Parameters:
- df_featurespandas.DataFrame
A dataframe containing shape and burst features for each cycle.
- sig_lenint
Length of a 1D time series.
- epoch_lenint
The length of each epoched data in units of signal samples.
- Returns:
- dfs_featureslist of pd.DataFrame
A list of features dataframes that have been epoched.
Examples
Epoch a dataframe in 1 seconds intervals:
>>> from neurodsp.sim import sim_bursty_oscillation >>> from bycycle.features import compute_features >>> fs = 500 >>> sig = sim_bursty_oscillation(10, fs, freq=10) >>> df_features = compute_features(sig, fs, f_range=(8, 12), center_extrema='peak') >>> dfs_features = epoch_df(df_features, len(sig), fs)