bycycle.utils.split_samples_df

bycycle.utils.split_samples_df(df_features)[source]

Move cyclepoints sample indices columns to a separate dataframe.

Parameters:
df_featurespandas.DataFrame

Dataframe output of compute_features() or :func`~.compute_shape_features`.

Returns:
df_featurespandas.DataFrame

A dataframe without sample indices columns removed.

df_samplespandas.DataFrame

A dataframe only containing sample indices columns.

Examples

Separate sample/signal indices into a separate dataframe:

>>> 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')
>>> df_features, df_samples = split_samples_df(df_features)