A Deep Dive into Los Angeles Crime

Deon | Nov. 19, 2023, 7:25 p.m.

The city of Los Angeles is known for a lot of different things. Warm weather, the beach, Hollywood etc. Unfortunately there are also some negative things that LA is known for as well. In this post, we're going to analyze and visualize what crime has looked like in LA over the past few years. We will see if we can gain any insights that can be useful for citizens of Los Angeles, visitors or even law enforcement. I found a good dataset for LA crime on Kaggle. It covers almost all crimes reported in Los Angeles from the years 2020 to October of 2023. The dataset has very useful information from a data science perspective, such as dates of crime occurrences, latitude & longitude coordinates, the status of the investigation and more. The dataset also contains a description of the premises where the crime occurred. For this article, I want to focus on "street" crimes as reported in the dataset. I made this decision because everyone has to be outside and will be vulnerable to these events at some point, so this analysis might provide some insights that can be helpful to anyone living in, or visiting Los Angeles . Using Python, pandas, & matplotlib, I started off by creating a line plot that provides a day by day overview of the street crime activity in LA from the years 2020 to 2023

:The figure above depicts the crime count for each day squeezed into a 468px × 339px line plot. After analyzing it for a few moments, one thing is sure to stand out; that is, the large spike in crime that appears to have occurred on some days in late spring or early summer of 2020. We see that around that time is the only time in almost 3 years that we see over 250 street crimes in a single day. Another interesting observation is that there appears to be a small upward trend in average street crimes committed per day, starting in Spring of 2021 and onward. I immediately wanted to get to the bottom of that sharp uptick in crime so began a separate analysis on the months of May and June in 2020. After filtering the data for those time intervals I created a bar graph showing the top 10 dates ordered by street crime frequency. I discovered that the single day in the whole dataset that exceeded 250 street crimes was May 30, 2020 at 273. And May 29, 2020 was the 2nd highest date in May for street crimes, After googling Los Angeles news for those dates I found out that that was due to the George Floyd protest and riots in the city that had climaxed on the 29th and the 30th.

After discovering the most plausible explanation for the sharp uptick on May 30th, 2020, I wanted to get a better understanding for the actual crimes that were being committed out on the streets of Los Angeles. I threw some code together to visualize the frequencies of the top ten street crimes that were committed in the month of May of 2020 and compares the frequencies of those same ten crimes for the following month of June to see how the frequency distributions progressed from month to month. The figure below is what I came up with. Now, I've heard about car thefts being a problem in Los Angeles over the past few years, well this dataset proves that it is, by a pretty comfortable margin, the most commonly occurring crime in the streets of LA. There were 1,303 vehicles that were purported to have been stolen in May of 2020. In June of the same year, 1,506 vehicles were purported stolen in that month; that is a 15.58% increase from May's total, and almost triple the amount of the next most frequently occurring crime in May, which is petty theft from a motor vehicle. Interestingly, the number of petty thefts from vehicles decreased from May to June by 15.2%, and the number of burglaries from vehicles saw a less significant reduction, but still a decrease in frequency by 5.4%. Contrastingly, the last street crime having to do with a motor vehicle depicted in the figure, which is grand theft from a motor vehicle of items $950.1 and over, saw a 38% increase in frequency. There could be some interesting correlations between those particular crimes dealing with vehicles, and it might be worth doing a multiple regression analysis on those features to test for the level of causality between them. Knowing if one crime has a high causality level for another crime can help law enforcement take the "two birds, one stone" approach to preventing some of these crimes. For example, if we find that reducing the number of stolen vehicles causes a reduction in grand thefts from motor vehicles, then it may be wise for law enforcement to focusing more on trying to prevent car thefts to see an overall reduction in crime, especially crimes dealing with motor vehicles. Just be sure to lock your car doors when you're in LA and maybe consider taking additional measures to secure your vehicle, such as adding cameras, trackers, and alarms. LA might also be a great place to market and sell all sorts of vehicle security devices, based on this data.

Now when it comes to people getting their vehicles stolen in LA, some areas are a lot worse than others. And that is the kind of information that can be highly useful to law enforcement and civilians. I mentioned earlier that the dataset contained latitude and longitude values to tell us exactly where the crime was purported to have happened. So I already knew that I would probably make use of one of my favorite python packages for visualizing and working with map/geographical data -folium. With folium, it is possible to create an interactive map that will show exactly where particular crimes are happening, and we can also include more information about each event when the user zooms all the way in and hovers over an individual crime marker. The map frame below depicts the exact location of all the reported vehicle thefts for September of 2023. The map uses cluster markers. Each cluster marker accounts for a number of crimes that were committed in that area. That number is printed on each cluster marker and when you hover over the cluster marker, it shows a rough outline of that area. The more you zoom in, the smaller and more specific those areas get, until you're zoomed in close enough to see the individual crime event. The more you zoom out, the wider and more general the areas get. Not only does this help keep the map looking clean and neat, but it also makes it easier to tell how the crime events are distributed across different neighborhoods and districts in Los Angeles. For instance, when zoomed in at the neighborhood level, it becomes clear that East Vermont Knolls, Vermont Square, Florence and South Park were hot spots for vehicle theft in the month of September this year. The area in between Westmont and Watts also had a lot of car theft activity.