-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
25 lines (20 loc) · 774 Bytes
/
app.py
File metadata and controls
25 lines (20 loc) · 774 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import streamlit as st
import pandas as pd
st.set_page_config(page_title="Colab App", layout="wide")
st.title("My First Streamlit Web App")
st.header("Streamlit Demo on Google Colab")
st.write("This app is running live from a Google Colab notebook.")
st.sidebar.header("User Input Section")
name = st.sidebar.text_input("Enter your name:")
if name:
st.write(f"### Welcome, {name}!")
age = st.sidebar.slider("Select your age", 0, 100, 25)
st.sidebar.write(f"Your selected age: **{age}**")
if st.checkbox("Do you want to see a sample DataFrame?"):
st.subheader("Sample Data")
chart_data = pd.DataFrame({
'Serial': range(1, 6),
'Value': [20, 55, 60, 35, 80]
})
st.dataframe(chart_data)
st.line_chart(chart_data.set_index('Serial'))