Spaces:
Runtime error
Runtime error
Commit
·
d529d0a
1
Parent(s):
25a4db2
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import pandas as pd
|
| 3 |
+
import plotly.express as px
|
| 4 |
+
|
| 5 |
+
# Define the data
|
| 6 |
+
data = pd.DataFrame({
|
| 7 |
+
'Illness': ['Anxiety', 'Depression', 'Diabetes', 'Heart Disease'],
|
| 8 |
+
'Cost (Billion USD)': [42, 210, 327, 219]
|
| 9 |
+
})
|
| 10 |
+
|
| 11 |
+
# Define the sunburst plot
|
| 12 |
+
fig = px.sunburst(
|
| 13 |
+
data,
|
| 14 |
+
path=['Illness'],
|
| 15 |
+
values='Cost (Billion USD)',
|
| 16 |
+
color='Cost (Billion USD)',
|
| 17 |
+
color_continuous_scale='blues'
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
# Define the Streamlit app
|
| 21 |
+
st.title('Cost of Illnesses in Billion USD per Year')
|
| 22 |
+
st.plotly_chart(fig, use_container_width=True)
|