Grouping and Merging Data
You're doing great with the data visualization, but now your boss wants you to dig even deeper! 💃
Your boss gave you a scientific paper that says, "Hot temperatures directly influence aggression and violence."
🔥 -> 👊?
Your task now is to check if the data from the LAPD supports this claim:
So, what’s the next step? Let’s break it down!
Calculate the Crime Count for Each Day
To see if hot weather leads to more crime, we need to compare the number of crimes on hot days to those on cooler days. Luckily, you already have the weather dataset with daily temperatures! 🌡️
What’s still missing? The crime count per day!
Group your crime data by day and count how many crimes occurred each day. This will give you the total number of crimes on each day, which is exactly what you need to compare with the temperatures.

Merge the Temperature and Crime Count
Now that you have both the daily crime counts and daily temperatures, it’s time to merge the two datasets. By doing this, you'll be able to easily see which day had what temperature and how many crimes occurred.
Last updated