pm4py.read.read_xes#
- pm4py.read.read_xes(file_path: str, variant: str | None = None, return_legacy_log_object: bool = False, encoding: str = 'utf-8', **kwargs) DataFrame | EventLog [source]#
Reads an event log stored in XES format (see xes-standard). Returns a table (pandas.DataFrame) view of the event log or an EventLog object.
- Parameters:
file_path (
str
) – Path to the event log (.xes file) on disk.variant – Variant of the importer to use. Options include: - “iterparse” – traditional XML parser, - “line_by_line” – text-based line-by-line importer, - “chunk_regex” – chunk-of-bytes importer (default), - “iterparse20” – XES 2.0 importer, - “rustxes” – Rust-based importer.
return_legacy_log_object (
bool
) – Boolean indicating whether to return a legacy EventLog object (default: False).encoding (
str
) – Encoding to be used (default: utf-8).**kwargs –
Additional parameters to pass to the importer.
- Return type:
pandas.DataFrame or pm4py.objects.log.obj.EventLog
import pm4py log = pm4py.read_xes("<path_to_xes_file>")