1

I have a data set of accidents wherein each accident is given an ID, a small description and time of occurrence in 24hr hh:mm format. Accidents are not unique. I am trying to plot a histogram showing the frequency of accidents in each time-slice (i.e. 15 min period or 30 min Period)

The goal is to bin the 'Time' column into bins of 15 mins, and to show in a histogram the number of accidents occurring in each bin. Time would be on x-axis and number of accidents on y-axis.

All the posts I have seen so far are about some kind of a bi-variate distribution. I only have one variable - Time. Also, it's a datetime object, so there is some problem in plotting it directly.

Aseem Awad
  • 173
  • 1
  • 9
  • See [this question](http://stackoverflow.com/questions/9627686/plotting-dates-on-the-x-axis-with-pythons-matplotlib) for how to use datetimes as axis labels. But anyway you wrote that you want to plot the frequency of events so I don't see how need datetimes on an axis at all. x-axis should be event and y-axis is frequency (or vice versa). – a_guest Feb 02 '17 at 01:14
  • Each event is not a distinct event. It's like a police record of accidents, each entry/row has an ID, severity and time. I'm trying to show, by a histogram, which time of the day most accidents happen. – Aseem Awad Feb 03 '17 at 09:14

0 Answers0