-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwidgets.py
More file actions
33 lines (24 loc) · 814 Bytes
/
Copy pathwidgets.py
File metadata and controls
33 lines (24 loc) · 814 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
26
27
28
29
30
31
32
33
import streamlit as st
import pandas as pd
st.title("Streamlit Web application...")
## Take input
name = st.text_input("Enter your name : ")
if name:
st.write(f"Hii, your name is {name}.")
age = st.slider("Select your age : ", 0, 100, 25)
st.write(f"your age is {age}.")
options = ['Python', 'C++', 'Java', 'Javascript']
choice = st.selectbox('Choose most use language..', options)
st.write(f"Your selected language : {choice}")
data = {
'Name': ['chandan', 'sumukhi', 'nikhil', 'abhay', 'vivek'],
'Age':[24, 24, 23, 23, 24],
'City':['Noida', 'Banglore', 'Bang', 'Delhi', 'Pune']
}
df = pd.DataFrame(data)
df.to_csv('sample.csv')
st.write(df)
upload_file = st.file_uploader('Choose a csv file : ', type='csv')
if upload_file is not None:
df = pd.read_csv(upload_file)
st.write(df)