pm4py.algo.filtering.pandas.prefixes package

Submodules

pm4py.algo.filtering.pandas.prefixes.prefix_filter module

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.

class pm4py.algo.filtering.pandas.prefixes.prefix_filter.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'
CASE_ID_KEY = 'pm4py:param:case_id_key'
FIRST_OR_LAST = 'first_or_last'
INDEX_IN_TRACE_KEY = 'index_in_trace_key'
INDEX_KEY = 'index_key'
STRICT = 'strict'
TEMP_COLUMN = 'temp_column'
USE_EXTREMES_TIMESTAMP = 'use_extremes_timestamp'
pm4py.algo.filtering.pandas.prefixes.prefix_filter.apply(df: pandas.core.frame.DataFrame, activity: str, parameters: Optional[Dict[Any, Any]] = None)[source]

Filter all the prefixes to a given activity (first or last occurrence of the activity in the case).

Parameters
  • df – Dataframe

  • parameters – Parameters of the algorithm: - Parameters.CASE_ID_KEY => the case identifier column. - Parameters.ACTIVITY_KEY => the activity column. - Parameters.INDEX_IN_TRACE_KEY => attribute that should act as container of the index of the event inside

    the case.

    • Parameters.TEMP_COLUMN => temporary column which is used for internal purposes.

    • Parameters.FIRST_OR_LAST => filter on the first or last occurrence of an activity in the dataframe.

    • Parameters.STRICT => applies the filter in a strict (<) or lean (<=) way (boolean).

Returns

Dataframe filtered keeping the prefixes to a given activity (first or last occurrence of the activity in the case).

Return type

df

Module contents

This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).

PM4Py is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

PM4Py is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with PM4Py. If not, see <https://www.gnu.org/licenses/>.