Grouping and Merging Data
Last updated
Last updated
You're doing great with the data visualization, but now your boss wants you to dig even deeper!
Your boss gave you a 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!
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.
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.
: You can use at least 3 clever methods and functions from pandas to merge your datasets. Be creative. You can use merge()
, concat()
and join()
from pandas. You should read and look into methods and what the differences are. You've calculated the daily crime count before, you know the drill