forked from streamlit/streamlit-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
import pandas as pd | ||
import streamlit as st | ||
import plotly.express as px | ||
|
||
@st.cache | ||
def get_data(): | ||
url = "http://data.insideairbnb.com/united-states/ny/new-york-city/2019-09-12/visualisations/listings.csv" | ||
return pd.read_csv(url) | ||
df = get_data() | ||
# Sidebar Column | ||
st.sidebar.title('Sidebar Widgets') | ||
#radio button | ||
rating = st.sidebar.radio('Are You Happy with the Example',('Yes','No','Not Sure')) | ||
if rating == 'Yes': | ||
st.sidebar.success('Thank You for Selecting Yes') | ||
elif rating =='No': | ||
st.sidebar.info('Thank You for Selecting No') | ||
elif rating =='Not Sure': | ||
st.sidebar.info('Thank You for Selecting Not sure') | ||
#selectbox | ||
rating = st.sidebar.selectbox("How much would you rate this App? ", | ||
['5 Stars', '4 Stars', '3 Stars','2 Stars','1 Star']) | ||
st.sidebar.success(rating) | ||
st.sidebar.write('Find Square of a Number') | ||
#slider | ||
get_number = st.sidebar.slider("Select a Number", 1, 10) | ||
st.sidebar.write('Square of Number',get_number, 'is', get_number*get_number) |