Toronto Traffic Accidents

Last Update: October 26th, 2019.​

1) Project Goal

  • Determine whether accidents occur more frequently in certain areas of Toronto.

  • Determine whether accidents are more likely during different times of day.

  • Note: This project was completed as part of a team of 2, and was part of a larger project that was completed as a team of 5, for the University of Toronto's School of Continuing Studies SCS3250 Introduction to Data Science course.

2) Data Source & Preparation


Data Sources

Data Preparation

  • The KSI dataset was downloaded as a shape file, with each geographic element representing the location an accident took place. This dataset was then cleaned using the Python Pandas library.

  • Columns not of interest were dropped and duplicate records (e.g. due to multiple victims) were identified and dropped.

  • The GeoPandas library was then used to import the district boundary file and to perform the geo-spatial analysis.

3) Analysis


This heat map displays the total number of KSI accidents in Toronto by ward. As one might expect, the downtown core ward has the highest raw count of traffic accidents in the city. Traffic congestion, the density of pedestrians, or the convergence of motor vehicles, cycle paths, and pedestrians all might explain this.

This second heat map displays the percentage of accidents that are fatal in each ward. As seen above, the Scarborough Southwest ward has a high propensity for traffic accidents to be fatal. It is interesting to note that, while having the highest amount of accidents, the Spadina-Fort York ward has a low percentage of fatal accidents. This suggests that while areas dense in population result in high numbers of traffic accidents, they tend to be less severe overall when compared to suburban, satellite neighbourhoods that typically have higher traffic speed limits and less pedestrian and cycling-deem pathways.

When evaluating accidents per hour of the day, the most dangerous time proved to be between the hours of 5:00pm and 7:00pm, suggesting a direct correlation between rush hour and traffic accidents. However, this correlation only presents itself during the evening rush hour. While morning accidents see an increase from 6:00am to 7:00am (which is expected as more of the public gets onto the road), the number of accidents by hour flattens out thereafter.

© 2021 by ANDREW LAM