pm4py / pm4py-core

Public repository for the PM4Py (Process Mining for Python) project.
https://pm4py.fit.fraunhofer.de
GNU General Public License v3.0
722 stars 286 forks source link

Create new Trace instance #157

Closed jacksbrajin closed 4 years ago

jacksbrajin commented 4 years ago

Hi, i wonder how one can create a new Trace instance from, e.g. a list of Events extracted from a EventLog instance. I think its a easy question but I cannot find any hints neither in the documentation nor in the log.py source.

fit-alessandro-berti commented 4 years ago

Dear jacksbrajin,

You could look at the following example:

from pm4py.objects.log.log import Event, Trace

ev1 = Event({"concept:name": "A"}) ev2 = Event({"concept:name": "B"}) trace = Trace([ev1, ev2]) print(trace)

The trace is created from a list of events