Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,6 +10,8 @@ import streamlit as st
|
|
| 10 |
import json
|
| 11 |
import os
|
| 12 |
import seaborn as sns
|
|
|
|
|
|
|
| 13 |
|
| 14 |
# Configuring the web page and setting the page title and icon
|
| 15 |
st.set_page_config(
|
|
@@ -108,7 +110,20 @@ with tab1:
|
|
| 108 |
st.dataframe(bikelane_new[['prediction']].tail(5))
|
| 109 |
|
| 110 |
if st.button("Update status"):
|
| 111 |
-
st.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
|
| 113 |
with tab2:
|
| 114 |
st.markdown('This application is made as part of the module "Data Engineering and Machine Learning Operations in Business - F2024" in Business Data Science 2nd Semester at Aalborg University Business School.')
|
|
|
|
| 10 |
import json
|
| 11 |
import os
|
| 12 |
import seaborn as sns
|
| 13 |
+
import time
|
| 14 |
+
import random
|
| 15 |
|
| 16 |
# Configuring the web page and setting the page title and icon
|
| 17 |
st.set_page_config(
|
|
|
|
| 110 |
st.dataframe(bikelane_new[['prediction']].tail(5))
|
| 111 |
|
| 112 |
if st.button("Update status"):
|
| 113 |
+
# values cannot be used in st.session_state!!
|
| 114 |
+
if 'my_values' not in st.session_state:
|
| 115 |
+
st.session_state.my_values = list()
|
| 116 |
+
|
| 117 |
+
if not st.session_state.my_values:
|
| 118 |
+
st.session_state.my_values.append(0)
|
| 119 |
+
|
| 120 |
+
new_value = st.session_state.my_values[-1] + random.randrange(-100, 100) / 100
|
| 121 |
+
|
| 122 |
+
st.session_state.my_values.append(new_value)
|
| 123 |
+
|
| 124 |
+
time.sleep(.2)
|
| 125 |
+
|
| 126 |
+
st.experimental_rerun()
|
| 127 |
|
| 128 |
with tab2:
|
| 129 |
st.markdown('This application is made as part of the module "Data Engineering and Machine Learning Operations in Business - F2024" in Business Data Science 2nd Semester at Aalborg University Business School.')
|