Don’t want to be nailed? The City of Toronto publishes their parking tickets data every year. Below is one year parking tickets data to show you when and where most tickets are issued.
I will be using R and some of its extended libraries for this project.
The dataset can be accessed through City of Toronto Open Data Portal. It contains 2256761 parking tickets, from January 1 2016 to December 31 2016, the amount from 0 to $450. I will omit missing values in the data, that means 1331 rows are omitted. Also I will need to do some cleaning such as change the date and time format to the appropriate format. I also added a new column - day of week.
The number of parking tickets distributed almost evenly throughout the year. It seems slowing down towards the end of the year.
The time distribution appears bimodal with period peaking around 9am to 1pm and again after midnight. The safest time to park your car without being nailed is around 5 and 6am.
The most common amount is $30, then $50, then $40. I believe the “0” value means the parking tickets were cancelled.
So which dates have the most number of infractions? and which dates have the least number of infractions?
December 25 has the least number of parking tickets issued. I wonder why.
Time to add day of week column.
Apparently, less infractions happened in the weekend than during the weekdays.
Now let’s look at what the infractions are. Because there are more than 200 different infractions, it makes sense to only look at the top 10.
Now, what are the top 10 locations that have the most infractions?
Here it is! Be aware when you are around those areas.
How about the trend? Is there any infraction type increase or decrease over time?
This is not a good looking graph. Most of the top infractions have been steady over time. only “PARK FAIL TO DISPLAY RECEIPT” had dropped since fall, and “PARK MACHINE-REQD FEE NOT PAID” had an increase since October. Does it have anything to do with the season? or weather? Or simply more park machines broken toward the end of the year?
This is a much better looking graph. the highest counts are around noon time during the weekday, this trend changed during the weekend.
Finally, let’s look at each of the top 10 infractions, how do they change during the time of the day.
I found two sharp curved infractions interesting, one is “STOP-SIGNED HIGHWAY RUSH-HOUR”, there are two peak infraction hours around 8am and 4pm during the weekdays, the weekend is very quiet. It makes sense as it labels as “RUSH-HOUR”. Another is ‘PARK-LONGER THAN 3 HOURS’, this is the only infractions happened more during the early hours around 4am, this applies to weekends as well as weekdays.
It seems to me that residents live in an appartment building without a garage will be ticketed for overnight parking on their street if their street has no on-street permits. That’s why most of the infractions happened in the early hours of the day.
The above analysis doesn’t represent all the problems and areas since not every illegally parked car will be reported. It does give a general idea and might start a conversation on how and where the City of Toronto should intervene.
Source code used to created this post can be found here.