Analyzing traffic violations

Question

Suppose we have a hypothesis that more tickets are given out by police towards the end of the month, as they approach the deadline on their quotas. Given the following dataset covering traffic violations over a few years for a specific municipality, determine if there is a difference in end of month violations (say, the last 7 days of a month) compared to the whole month. You'll need to use the "Vio Date" field to parse out the day of the month. For example, if a ticket was given on 01-28-2018, you'll want to parse out the date (28).

To help get you started, below is code (Python) to import the referenced dataset:

# Import libraries
%matplotlib inline
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
# Import data
df = pd.read_csv('https://raw.githubusercontent.com/erood/interviewqs.com_code_snippets/master/Datasets/traffic_data.csv' )

Solution

Access restricted

Subscribe to premium account to see the solution.

Get premium now