I have a DataFrame with two columns. One of them contains timestamps, and the other is the identifier of an action. Something like that:
2000-12-29 00:10:00 action1
2000-12-29 00:20:00 action2
2000-12-29 00:30:00 action2
2000-12-29 00:40:00 action1
2000-12-29 00:50:00 action1
...
2000-12-31 00:10:00 action1
2000-12-31 00:20:00 action2
2000-12-31 00:30:00 action2
I would like to know how many actions of a certain type were completed in a given day. That is, for each day, I need to calculate the number of occurrences of actionX and build this data with a date on the X axis and the number of occurrences of actionX on the Y axes for each date.
Of course, I can count actions on every day naively, just repeating my data. But what is the “right way” to do with pandas / matplotlib?
source
share