Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Type of comparison:
- `equal`: full event name match with element from ``event_list``;
- `startswith`: event name starts with element from ``event_list``;
- `contains`: event name contains element from ``event_list``.
Returns
--------
Filtered dataframe based on event names.
Return type
-------
pd.DataFrame
"""
self._init_cols(locals())
data = self._obj.copy()
func = getattr(preprocessing, '_event_filter_' + mode)
for event in event_list:
data = data.loc[func(data[self._event_col()], event)]
return data.reset_index(drop=True)