Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -92,7 +92,7 @@ def SIR(country,t_infective):
|
|
92 |
r_initial = 0.00
|
93 |
s_initial = 1 - i_initial - r_initial
|
94 |
|
95 |
-
t = np.linspace(0,
|
96 |
x_initial = s_initial, i_initial, r_initial
|
97 |
soln = odeint(deriv, x_initial, t, args=(beta, gamma))
|
98 |
s, i, r = soln.T
|
@@ -107,13 +107,13 @@ def main():
|
|
107 |
with st.form("questionaire"):
|
108 |
country = st.selectbox("Country",data['location'].unique())# user's input
|
109 |
recovery = st.slider("How long Monkeypox recover?", 21, 31, 21)# user's input
|
110 |
-
|
111 |
# clicked==True only when the button is clicked
|
112 |
clicked = st.form_submit_button("Show Graph")
|
113 |
if clicked:
|
114 |
|
115 |
# Show SIR
|
116 |
-
SIR_param = SIR(
|
117 |
|
118 |
st.pyplot(SIR_param[-1])
|
119 |
st.success("SIR model parameters for "+str(country)+" is")
|
|
|
92 |
r_initial = 0.00
|
93 |
s_initial = 1 - i_initial - r_initial
|
94 |
|
95 |
+
t = np.linspace(0, 1000, 1000)
|
96 |
x_initial = s_initial, i_initial, r_initial
|
97 |
soln = odeint(deriv, x_initial, t, args=(beta, gamma))
|
98 |
s, i, r = soln.T
|
|
|
107 |
with st.form("questionaire"):
|
108 |
country = st.selectbox("Country",data['location'].unique())# user's input
|
109 |
recovery = st.slider("How long Monkeypox recover?", 21, 31, 21)# user's input
|
110 |
+
country_code = code[country][0]
|
111 |
# clicked==True only when the button is clicked
|
112 |
clicked = st.form_submit_button("Show Graph")
|
113 |
if clicked:
|
114 |
|
115 |
# Show SIR
|
116 |
+
SIR_param = SIR(country_code,recovery)
|
117 |
|
118 |
st.pyplot(SIR_param[-1])
|
119 |
st.success("SIR model parameters for "+str(country)+" is")
|