pm4py.algo.filtering.pandas.suffixes package#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

Submodules#

pm4py.algo.filtering.pandas.suffixes.suffix_filter module#

PM4Py – A Process Mining Library for Python

Copyright (C) 2024 Process Intelligence Solutions UG (haftungsbeschränkt)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program 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 Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see this software project’s root or visit <https://www.gnu.org/licenses/>.

Website: https://processintelligence.solutions Contact: info@processintelligence.solutions

class pm4py.algo.filtering.pandas.suffixes.suffix_filter.Parameters(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]#

Bases: Enum

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

Filter all the suffixes 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#

df

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