File size: 568 Bytes
d30adf0
fa51aa8
baa2a05
db9bec1
 
 
6e598b9
 
db9bec1
8105114
 
6bc184e
 
fa51aa8
 
 
 
db9bec1
6bc184e
 
da59264
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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"],
]

acontainer1 = st.empty()
acontainer2 = st.empty()

def aoptionchange(aparam):
	acontainer2.write(aparam)
adf = pd.DataFrame(
	astations,
	columns=['akey','astationcode','alatitude','alongitude','atitle',]
)
aoption = acontainer1.selectbox(
	'Which station?',
	adf['atitle'],
	on_change=aoptionchange,
	args={'aselectedindex':index,}
)