Borya-Goldarb commited on
Commit
86ed73b
·
verified ·
1 Parent(s): d25f2c9

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +51 -0
app.py ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ def main():
3
+ set_session_state()
4
+ def display_list_and_input():
5
+ option_choice = st.selectbox("Select a property address", df_options)
6
+ return option_choice
7
+
8
+
9
+ if 'user_select_value' not in st.session_state:
10
+ st.session_state['user_select_value'] = ""
11
+ if 'year_buit' not in st.session_state:
12
+ st.session_state['year_buit'] = 1990
13
+ if 'execution_dates' not in st.session_state:
14
+ st.session_state['execution_dates'] = 2014
15
+ if 'LSF' not in st.session_state:
16
+ st.session_state['LSF'] = 75000
17
+
18
+ st.title("Search")
19
+ df_properties = pd.read_csv("market_underwriting_pred.csv", encoding='utf-8')
20
+ # df_options = df_Atlanta.google_ola.values[:]
21
+ df_options = st.session_state.get("df_options", [st.session_state['user_select_value']] + df_properties.google_ola.tolist())
22
+
23
+ # search_options = [""] + options
24
+ selected_option = display_list_and_input()
25
+
26
+
27
+ # Checkbox
28
+ option1 = st.checkbox("Functionality problems", value=False)
29
+ option2 = st.checkbox("Special tax area", value=False)
30
+ # special parameters free text
31
+ user_input = st.text_input("Enter special parameters of the building:")
32
+
33
+ if st.button("Submit"):
34
+ st.session_state['user_select_value'] = selected_option
35
+ st.session_state['year_buit'] = 1990
36
+ st.session_state['execution_dates'] = 2014
37
+ st.session_state['LSF'] = 75000
38
+ market_val, submarket_val = get_market_submarket(df_properties, selected_option)
39
+ st.write(market_val)
40
+ st.write(submarket_val)
41
+
42
+
43
+ if st.button("Home"):
44
+ st.switch_page("your_app.py")
45
+ if st.button("Page 1"):
46
+ st.switch_page("pages/page_1.py")
47
+ if st.button("Page 2"):
48
+ st.switch_page("pages/page_2.py")
49
+
50
+ if __name__ == "__main__":
51
+ main()