poreflow.events.selection
¶
filter_from_config(events, conditions)
¶
Filter using a dictionary of conditions
Filter using a dictionary of conditions formatted as: {"min_[col]": value, ...} or {"max_[col]": value, ...}
Where [col] is a column of a feature in an EventsDataFrame such as step_rate, duration, etc.
An example dictionary would look like: {'min_duration': 1, 'min_n_steps': 45, 'max_n_steps': 800, 'min_binned_entropy_of_means': 2.5, 'min_step_rate': 12, 'min_ios': 200, 'max_ios': 300}
These conditions can easily be loaded from a TOML configuration file.
Returns:
| Type | Description |
|---|---|
DataFrame
|
pd.DataFrame: A truth table whether events meet the specified conditions. The columns contain the conditions. Also contains a column "all", which is the boolean mask of all the events that meet each condition. |