Closed AndreasKarasenko closed 1 year ago
Dear @AndreasKarasenko
Thank you for signaling. We will fix this in the next release.
Errata corrige: the allowed distribution type are just days_month, months, years, hours, days_week, weeks
With weeks it works
Sorry, there was a typo in my initial comment, when I encountered the problem I did use the correct distr_type.
In this sense the problem persists on my end (without the mentioned fix). I suppose that there might be a mismatch in the type of timestamp in my logs and the ones expected by pm4py (can you tell me which one you expect?). I will come back to this issue next week with a reproducible example. For now changing the line above as I mentioned fixes it for me locally. With the type of timestamps I have (see below) I could also drop the call to isocalendar(), which also fixes it.
Additional Information: pandas version: 2.0.1 Timestamp type: pandas._libs.tslibs.timestamps.Timestamp
When using view_events_distribution_graph with dist_type="week" pm4py executes "x.isocalendar().week" where x is a pandas.Timestamp object.
However pandas.Timestamp.isocalendar() returns [int, int, int] which then throws the above error.
Suggestion: change line 117 in pm4py\statistics\attributes\log\get.py from:
values = Counter(x.isocalendar().week for x in timestamp_values)
to:values = Counter(x.isocalendar()[1] for x in timestamp_values)