Cannabis Sales and Crime Rates

Baelee Winkle
5 min readFeb 8, 2022

--

The Colorado Amendment 64, also known as the Colorado Marijuana Legalization Amendment, was passed by voters in November of 2012. This law aimed to replace marijuana prohibition with legalization, taxation, and regulation of marijuana for adults over 21 years of age. Since this law passed, the topic of weed legalization for recreational use and state-licensed retail sales has caused controversial debate among residents, as well as those around the country. While the legalization of weed has benefited Colorado’s economy immensely, some argue that it has increased crime rates in the state. Do the cannabis sales in certain counties and the crime rates in certain counties have a correlation in the state of Colorado? If so, what is the correlation and which county has the highest correlation?

My hypothesis is that cannabis sales and crime rates have a negative correlation with one another. I believe this based on previous research and evidence that proves how cannabis has improved employment rates, lowered crime, and improved schools. I am going to test my hypothesis by using data from the “co_cannabis_sales” zip file with data ranging from 2014–2021 and the “co_county_crimes” csv file with data ranging from 2008–2021. I will be looking at the sales in correlation to the number of crimes in each county per year.

To start, I loaded all the libraries I will need in order to inspect the data, including pandas, numpy, Altair, and os. I started by reading in the “co_county_crimes” csv file using pandas to create a dataframe. The following table was produced.

I then used the os library to make a list of the files in the “co_cannabis_sales’’ file in order to display the contents of the file. With this list, I then created a for loop to load each of the csv files from the “co_cannabis_sale”’ file and stored each data frame into a new list. I then used the concat function to combine all the files in the new list into one dataframe. The following table was produced.

Looking at these data frames, I decided I wanted to clean up the data by using a pivot table on each data frame. I started by creating a pivot table using the “co_county_crimes” csv file. I used the ‘Year’ column as the index, the ‘County’ column as the columns, the different types of crimes, which include Crimes Against Person, Crimes Against Property, Drug Equipment Violations, and Drug/Narcotic Violations, and used sum for the agg func. This resulted in the following pivot table.

With this pivot table, I was able to identify that the county with the highest number of crimes was Yuma county and the most common crime was Drug/Narcotic Violations. The county that had the least number of crimes was Mineral County with the least common crime being Drug Equipment.

I then created a pivot table using the new cannabis dataframe I created above. I used the ‘Year’ column as the index, the ‘County’ column as the columns, the total cannabis sales as the value, and used sum for the agg func. This resulted in the following pivot table.

With this pivot table, I was able to identify that the county with the highest number of cannabis sales was Denver County in 2020 with $55,559,414.00 in sales. The county with the least number of cannabis sales was San Juan county in 2019with $13,232.00 in sales.

After analyzing these pivot tables, I decided I wanted to find a way to visualize my findings. I used Altair to create a visualization of all of the cannabis sales in each county. I used ‘Sales’ as the x coordinate and “County” as the y coordinate. The following visualization was produced. As one can see, Denver has the most sales.

I then used Altair again to create visualizations of total crimes in each county against both people and property. I used ‘Crimes Against Person/Property’ as the x coordinate and “County” as the y coordinate. The following visualizations were produced. As you can see Denver experiences a high amount of crime on persons and properties.

Based on these visualizations, as well as the tables and dataframes, it can be concluded that cannabis sales and crime rates are potentially correlated in some ways based on numbers. Each county in both visualizations that show high sales show high crime rates and some of those that are low in sales show low crime rates. Denver has the highest correlation of cannabis sales and high crime rates. Further research and data is needed in order to determine other factors that contribute to crime rates before one can accurately confirm if the two are correlated.

--

--