a10's picture
Update app.py
6f24fe3
raw
history blame
628 Bytes
import streamlit as st
import pandas as pd
astations = [
["hongkongobservatory","HKO",22.3022566,114.1722662,"Hong Kong Observatory"],
["kingspark","KP",22.3115408,114.1685675,"Observatory Meteorological Station, King's Park"],
]
astationcolumns = ['akey','astationcode','alatitude','alongitude','atitle',]
acontainer1 = st.empty()
acontainer2 = st.empty()
def aoptionchange(aparam):
acontainer2.write(aparam)
adf = pd.DataFrame(
astations,
columns=astationcolumns
)
aoption = acontainer1.selectbox(
'Which station?',
adf['atitle'],
on_change=aoptionchange,
args={'aselected':aoption,}
)
#acontainer2.write(aoption)