<img src=/assets/header-opioid-epidemic.png>
Project 3: Opioid Drug Overdose Deaths
Project Description
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:
Website
Bootstrap Website ~ (Brandon)
https://basse058.github.io/Project-3-Overdose/templates/index.html
![](assets/project-3-overdose-webpage-screenshot.jpg)
- 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/
![image](visualizations\lineChart.png)
- 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.
Interactive Visualizations
Plotly Choropleth Map ~ (Brandon)
https://basse058.github.io/Project-3-Overdose/plotly-map
![](assets/plotly-choropleth-map.jpg)
- 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.
Extract
Transform
Load
- 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
![](assets/anychart-choropleth-map.jpg)
* Includes JavaScript library previously unintroduced during class
- 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.
</ul>
Extract
- Data copied from previous map into data.json file for AnyChart Choropleth Map
Transform
- Data was already clean from previous map.
Load
- Javascript pulled from CDN into anychart.html
- Data read from data.json
</ul>
Charts & Graph
Bar Charts & Line Graph ~ (Chris, Madina & Cody)
https://github.com/basse058/Project-3-Overdose/BarCharts/barchart_index.html
![image](visualizations\InteractiveCharts.png)
* Linegraph includes JavaScript library previously unintroduced during class
</p>
- Interactivity: Data for each individual state can be viewed by selecting the state from the drop down list on the left.
Extract
Transform
- 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:
</ul>
Load
- Transposed dfs saved as JSON files for website use.
Presentation
Slideshow ~ (Madina)
https://docs.google.com/presentation/d/1yLrDGqCc9DOo0mkTwuMQH3fmSIiOUHch/