Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
ADDED
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# -*- coding: utf-8 -*-
|
2 |
+
"""app.ipynb
|
3 |
+
|
4 |
+
Automatically generated by Colaboratory.
|
5 |
+
|
6 |
+
Original file is located at
|
7 |
+
https://colab.research.google.com/drive/1bfEMI_uZXaosL5o-R1i1eTanG9-2hP7Y
|
8 |
+
|
9 |
+
*`Uma Namboothiripad Assignment #2`*
|
10 |
+
"""
|
11 |
+
|
12 |
+
import streamlit as st
|
13 |
+
import pandas as pd
|
14 |
+
import urllib
|
15 |
+
|
16 |
+
st.title("Plan ahead so you know where you are going once you land in Barcelona. Choose your hotel here!")
|
17 |
+
|
18 |
+
st.markdown("Barcelona has one of the highest pickpockets of any city in Europe. You better get a hotel before you go")
|
19 |
+
|
20 |
+
text = st.text_input('What attributes do you want in a hotel:')
|
21 |
+
|
22 |
+
n_results = st.slider('How many choices in hotels do you want?', 1,5,8)
|
23 |
+
|
24 |
+
dataurl = 'https://colab.research.google.com/drive/1_sofOjXRDnId49NOup4sdiVS1E_51T-b?usp=sharing'
|
25 |
+
@st.cache(persist=True)
|
26 |
+
|
27 |
+
def load_data():
|
28 |
+
data_url = urllib.request.urlopen('https://colab.research.google.com/drive/1_sofOjXRDnId49NOup4sdiVS1E_51T-b?usp=sharing')
|
29 |
+
df = pd.read_csv('HotelListInBarcelona__en2019100120191005.csv')
|
30 |
+
return(df)
|
31 |
+
if st.button('Show Hotels'):
|
32 |
+
if len(text) >50:
|
33 |
+
st.write('Okay boomer, try to limit your expectations and reduce the number of characters in your search')
|
34 |
+
|
35 |
+
def run():
|
36 |
+
st.subheader("Options for hotels in Barcelona")
|
37 |
+
df = load_data()
|
38 |
+
st.dataframe(df)
|
39 |
+
|
40 |
+
if __name__ == '__main__':
|
41 |
+
run()
|