a10 commited on
Commit
6f18e1d
·
1 Parent(s): 3b498d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -1,5 +1,4 @@
1
 
2
-
3
  import streamlit as st
4
  import pandas as pd
5
 
@@ -14,7 +13,9 @@ acontainer2 = st.empty()
14
  acontainer3 = st.empty()
15
 
16
  def asubmit(aparam):
17
- aparam["acontainer"].write((" {} ").format(aparam["aselected"]))
 
 
18
 
19
  adf = pd.DataFrame(
20
  astations,
@@ -25,4 +26,4 @@ aoption = acontainer1.selectbox(
25
  adf['atitle']
26
  )
27
  if acontainer2.button("Submit") == True:
28
- asubmit(aparam={"aselected":aoption,"acontainer":acontainer3,"adataframe":adf,})
 
1
 
 
2
  import streamlit as st
3
  import pandas as pd
4
 
 
13
  acontainer3 = st.empty()
14
 
15
  def asubmit(aparam):
16
+ adf2 = aparam["adataframe"]
17
+ aselecteditem = adf2[adf2.loc[adf2["atitle"]==aparam["aselected"]]]["astationcode"]
18
+ aparam["acontainer"].write((" {} ").format(aselecteditem))
19
 
20
  adf = pd.DataFrame(
21
  astations,
 
26
  adf['atitle']
27
  )
28
  if acontainer2.button("Submit") == True:
29
+ asubmit(aparam={"aselected":aoption,"acontainer":acontainer3,"adataframe":adf,})