pm4py.vis.save_vis_events_distribution_graph#

pm4py.vis.save_vis_events_distribution_graph(log: EventLog | DataFrame, file_path: str, distr_type: str = 'days_week', activity_key='concept:name', timestamp_key='time:timestamp', case_id_key='case:concept:name', graph_title: str | None = None, **kwargs)[source]#

Saves the distribution of the events in a picture file.

Observing the distribution of events over time helps infer work shifts, working days, and busy periods of the year.

Parameters:
  • log – Event log

  • file_path (str) – Destination path (including the extension)

  • distr_type (str) – Type of distribution (default: days_week): - days_month: Events distribution among days of a month (1-31) - months: Events distribution among months (1-12) - years: Events distribution among years - hours: Events distribution among hours of a day (0-23) - days_week: Events distribution among days of a week (Mon-Sun) - weeks: Events distribution among weeks of a year (0-52)

  • activity_key (str) – Attribute to be used as activity

  • case_id_key (str) – Attribute to be used as case identifier

  • timestamp_key (str) – Attribute to be used as timestamp

  • graph_title – Sets the title of the visualization (if provided)

import pm4py

pm4py.save_vis_events_distribution_graph(dataframe, 'ev_distr_graph.png', distr_type='days_week', activity_key='concept:name', case_id_key='case:concept:name', timestamp_key='time:timestamp')