This project analyzes opioid overdose data from the United States for all states for the year range including 2013 and 2022.
The data used was obtained from multiple websites listed below:
"U.S. State Overdose Deaths 2014-2019" data was scraped from the CDC webpage:
"U.S. State Opioid Dispensing Rate 2013-2019" data was scraped from the CDC webpage:
"Provisional Drug Overdose Death Counts 2015-2022" data was downloaded in CSV format from the CDC webpage:
Bootstrap Website ~ (Brandon)
https://basse058.github.io/Project-3-Overdose/templates/index.html
- Created header and footer.
- Created boxed layout.
- Added maps and charts via iframe embeds.
- Added JS script and CSS to add light and dark mode toggle.
OnRender Website using SQLite Database ~ (Cody)
https://project-3-h7kg.onrender.com/
- Provisional overdose death data sourced from CDC web page
- Dataset was loaded in SQLite database. Using the app.py file in root folder, the proper data is pulled for the line graph showing the monthly overdose counts for up to 12 months for the state selected by the dropdown like the bar charts.
- Render is used to host the site and SQLite database.
Plotly Choropleth Map ~ (Brandon)
https://basse058.github.io/Project-3-Overdose/plotly-map
- Interactivity: Hover over state to reveal deathes by year, total of all years and state abbreviation.
- Color gradient shows the highest (dark) to lowest (light) death rates among states.
- Data scraped and saved as OpioidDeathsAll.csv by Chris G.
- Data cleaned by renaming columns as appropriate.
- OpioidDeathsAll.csv data cleaned/formatted into OpioidDeathsAll-cleaned-3.csv file.
- OpioidsDeathAll-cleaned-3 imported via pandas into plotly-map.py
- plotly-map.py coded with df to include specific data from OpioidsDeathAll-cleaned-3
- Used plotly-map.py to read data, create dataframe, build map and output plotly-map.html file.
AnyChart Choropleth Map ~ (Brandon)
https://basse058.github.io/Project-3-Overdose/anychart.html
- Interactivity: Hover over state to see total deaths for the five year range of the dataset.
- Color gradient shows the highest (dark) to lowest (light) death rates among states.
- Data copied from previous map into data.json file for AnyChart Choropleth Map
Bar Charts & Line Graph ~ (Chris, Madina & Cody)
https://github.com/basse058/Project-3-Overdose/BarCharts/barchart_index.html
- Interactivity: Data for each individual state can be viewed by selecting the state from the drop down list on the left.
- Opioid Prescription Data was scraped and saved as DRState2013.csv to DRState2019.csv
- Overdose Data was scraped and saved as DeathState2014.csv to DeathState2020.csv
- Individual csv files read into pandas DataFrames,
- df column names standardized and extraneous columns dropped,
- dfs merged into a single df for each dataset:
- df for each dataset transposed into barchart-ready formats:
- Transposed dfs saved as JSON files for website use.