Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -5,3 +5,25 @@ import pandas as pd
|
|
5 |
# Streamlit app
|
6 |
st.title("Private Sample")
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
# Streamlit app
|
6 |
st.title("Private Sample")
|
7 |
|
8 |
+
progress_bar = st.progress(0)
|
9 |
+
status_text = st.empty()
|
10 |
+
chart = st.line_chart(np.random.randn(10, 2))
|
11 |
+
|
12 |
+
for i in range(100):
|
13 |
+
# Update progress bar.
|
14 |
+
progress_bar.progress(i + 1)
|
15 |
+
|
16 |
+
new_rows = np.random.randn(10, 2)
|
17 |
+
|
18 |
+
# Update status text.
|
19 |
+
status_text.text(
|
20 |
+
'The latest random number is: %s' % new_rows[-1, 1])
|
21 |
+
|
22 |
+
# Append data to the chart.
|
23 |
+
chart.add_rows(new_rows)
|
24 |
+
|
25 |
+
# Pretend we're doing some computation that takes time.
|
26 |
+
time.sleep(0.1)
|
27 |
+
|
28 |
+
status_text.text('Done!')
|
29 |
+
st.balloons()
|