pm4py.algo.filtering.pandas.rework package

Submodules

pm4py.algo.filtering.pandas.rework.rework_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.rework.rework_filter.Parameters(value)[source]

Bases: enum.Enum

An enumeration.

ACTIVITY_KEY = 'pm4py:param:activity_key'
CASE_ID_KEY = 'pm4py:param:case_id_key'
MIN_OCCURRENCES = 'min_occurrences'
POSITIVE = 'positive'
pm4py.algo.filtering.pandas.rework.rework_filter.apply(df0: pandas.core.frame.DataFrame, activity: str, parameters: Optional[Dict[Any, Any]] = None) pandas.core.frame.DataFrame[source]

Applies the rework filter on the provided dataframe and activity. This filter the cases of the log having at least Parameters.MIN_OCCURRENCES (default: 2) occurrences of the given activity.

It is also possible (setting Parameters.POSITIVE to False) to retrieve the cases of the log not having the given activity or having the activity occurred less than Parameters.MIN_OCCURRENCES times.

Parameters
  • df0 – Dataframe

  • activity – Activity of which the rework shall be filtered

  • parameters – Parameters of the filter, including: - Parameters.ACTIVITY_KEY => the attribute to use as activity - Parameters.CASE_ID_KEY => the attribute to use as case ID - Parameters.MIN_OCCURRENCES => the minimum number of occurrences for the activity - Parameters.POSITIVE => if True, filters the cases of the log having at least MIN_OCCURRENCES occurrences.

    if False, filters the cases of the log where such behavior does not occur.

Returns

Filtered dataframe

Return type

filtered_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/>.