How to use the retentioneering.core.preprocessing function in retentioneering

To help you get started, we’ve selected a few retentioneering examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github retentioneering / retentioneering-tools / retentioneering / core / utils.py View on Github external
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)