pm4py.streaming.conversion.from_pandas module#

class pm4py.streaming.conversion.from_pandas.Parameters(*values)[source]#

Bases: Enum

CASE_ID_KEY = 'pm4py:param:case_id_key'#
ACTIVITY_KEY = 'pm4py:param:activity_key'#
TIMESTAMP_KEY = 'pm4py:param:timestamp_key'#
INDEX_KEY = 'index_key'#
class pm4py.streaming.conversion.from_pandas.PandasDataframeAsIterable(dataframe: DataFrame, parameters: Dict[Any, Any] | None = None)[source]#

Bases: object

read_trace() Trace[source]#
reset()[source]#
to_trace_stream(trace_stream: LiveTraceStream)[source]#

Sends the content of the dataframe to a trace stream

Parameters:

trace_stream – Trace stream

pm4py.streaming.conversion.from_pandas.apply(dataframe, parameters=None) PandasDataframeAsIterable[source]#

Transforms the Pandas dataframe object to an iterable

Parameters:
  • dataframe – Pandas dataframe

  • parameters – Parameters of the algorithm, including: - Parameters.CASE_ID_KEY => the attribute to be used as case identifier (default: constants.CASE_CONCEPT_NAME) - Parameters.ACTIVITY_KEY => the attribute to be used as activity (default: xes_constants.DEFAULT_NAME_KEY) - Parameters.TIMESTAMP_KEY => the attribute to be used as timestamp (default: xes_constants.DEFAULT_TIMESTAMP_KEY)

Returns:

Iterable log object, which can be iterated directly or added to a live trace stream

(using the method to_trace_stream).

Return type:

log_iterable