import numpy as npimport pandas as pdimport matplotlib.pyplot as pltimport seaborn as snsimport altair as altimport plotly.express as pximport plotly.io as pioimport geopandas as gpdimport foliumpio.renderers.default='plotly_mimetype+notebook_connected'import warningswarnings.filterwarnings('ignore')
Make this Notebook Trusted to load map: File -> Trust Notebook
Reflection:
I chose to only use the continious mainland U.S. for the visualization in order to keep things clean and simple, as well as to eliminate variance because Alaska and Hawaii are likely to have much more varied crime rates due to their many differences (like size and population density) from the other states. I also decided to remove D.C. from the attributes in the dataset since it messed with the quartile ranges of the color scheme, and since you cannot see D.C without zooming in greatly, I opted to remove the city from the data. The high crime rate per capita in D.C. is because there is no rural areas that most other states have, thus leading to disproportionately high crime rates because of the urban landscape of the city. I wanted to include D.C. somehow, so I decided to add a marker for D.C. in the 2nd plot so we can still view their murder rate without it influencing the overall color scheme. I tried to chose color schemes that are red/orange because the data I am representing is negative (crime), and thus a state with a darker shade of red is associated with a bad metric. Overall, I was able to fix many of the limitations by removing bits of information that are not the most relevent, creating a balance of information and aesthetics.