Shiny for Python Choropleth Map
Mapping US gun violence mass shootings with ipyleaflet in Shiny for Python
Preamble
The purpose of this blog is two-fold:
- To showcase building a choropleth map application in Shiny for Python.
- To elucidate the location of deaths and injuries resulting from mass shootings within the US.
I had been thinking of creating an app on gun violence and mass shootings and figured with Shiny recently becoming available in Python, it was a good opportunity to give it a try.
That said, Shiny for Python is still in the development phase, many of the packages I attempted to use just aren’t accepted yet, so I had to find some work arounds. In fact as of December 2022 on their website it says:
“Note! Shiny for Python is currently in Alpha. It may be unstable, and the API may change. We’re excited to hear your feedback, but please don’t use it for production applications just yet!”
So please take note, and stick with RShiny if you are interested production applications.
Data
Mass Shooting
I decided to utilize the Gun Violence Archive (GVA) dataset on mass shootings from 2019–2022. GVA is a…