tilos commited on
Commit
bee4a9d
·
1 Parent(s): 2d61a94

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -1
app.py CHANGED
@@ -6,6 +6,7 @@ import datasets
6
  import requests
7
  import json
8
  import dateutil.parser as dp
 
9
 
10
  title = "Stoclholm Highway E4 Real Time Traffic Prediction"
11
  description = "Stockholm E4 (59°23'44.7"" N 17°59'00.4""E) highway real time traffic prediction, updated in every hour"
@@ -47,6 +48,15 @@ fesn1h = json_response_smhi["timeSeries"][0]["parameters"][8]["values"][0
47
  vis = json_response_smhi["timeSeries"][0]["parameters"][9]["values"][0] # Visibility
48
 
49
 
50
- row = [referenceTime, t, ws, prec1h, fesn1h, vis, confidence, congestionLevel]
 
 
 
 
 
 
 
 
 
51
 
52
  gr.Interface(fn = infer, inputs = inputs, outputs = outputs, title=title, description=description, examples=row).launch()
 
6
  import requests
7
  import json
8
  import dateutil.parser as dp
9
+ import pandas as pd
10
 
11
  title = "Stoclholm Highway E4 Real Time Traffic Prediction"
12
  description = "Stockholm E4 (59°23'44.7"" N 17°59'00.4""E) highway real time traffic prediction, updated in every hour"
 
48
  vis = json_response_smhi["timeSeries"][0]["parameters"][9]["values"][0] # Visibility
49
 
50
 
51
+ row ={"referenceTime": referenceTime,
52
+ "t": t,
53
+ "ws": ws,
54
+ "prec1h": prec1h,
55
+ "fesn1h": fesn1h,
56
+ "vis": vis,
57
+ "confidence": confidence,
58
+ "congestionLevel": congestionLevel}
59
+
60
+ row = pd.DataFrame.from_dict(row)
61
 
62
  gr.Interface(fn = infer, inputs = inputs, outputs = outputs, title=title, description=description, examples=row).launch()