a10 commited on
Commit
516120f
·
1 Parent(s): ad8cd91

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -4,13 +4,16 @@
4
  import streamlit as st
5
  import datetime
6
  import pandas as pd
 
7
 
8
  backlogmax = 4
9
  today = datetime.date.today()
10
 
11
  ayear = int(today.strftime("%Y"))-1
12
- st.write(ayear)
13
  for i in range(ayear-backlogmax,ayear,1):
14
  df = pd.read_csv("https://data.weather.gov.hk/weatherAPI/opendata/opendata.php?dataType=CLMTEMP&year={}&rformat=csv&station=HKO").format(i)
15
  st.write(i)
16
- st.write(df)
 
 
 
4
  import streamlit as st
5
  import datetime
6
  import pandas as pd
7
+ import numpy as np
8
 
9
  backlogmax = 4
10
  today = datetime.date.today()
11
 
12
  ayear = int(today.strftime("%Y"))-1
13
+ st.write(type(ayear))
14
  for i in range(ayear-backlogmax,ayear,1):
15
  df = pd.read_csv("https://data.weather.gov.hk/weatherAPI/opendata/opendata.php?dataType=CLMTEMP&year={}&rformat=csv&station=HKO").format(i)
16
  st.write(i)
17
+ df = df.reset_index() # make sure indexes pair with number of rows
18
+ for index, row in df.iterrows():
19
+ st.write(row[1])