Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -143,7 +143,7 @@ def get_name_of_cities():
|
|
| 143 |
|
| 144 |
# Make the API request for Swedavia API
|
| 145 |
response = requests.get(swedavia_url, headers = headers)
|
| 146 |
-
response1 = requests.get(
|
| 147 |
flights_swedavia = response.json()
|
| 148 |
flights_swedavia1 = response1.json()
|
| 149 |
|
|
@@ -211,7 +211,7 @@ selected_columns = ['destination', 'airport code', 'flight number', 'ontime', 'd
|
|
| 211 |
ciccio, pasticcio = pd.DataFrame(), pd.DataFrame()
|
| 212 |
cities_datafram = get_name_of_cities()
|
| 213 |
ciccio = get_today_dataframe()
|
| 214 |
-
ciccio = ciccio.rename(columns={'airport':'airport code'
|
| 215 |
today_dataframe = ciccio[selected_columns]
|
| 216 |
pasticcio = get_tomorrow_dataframe()
|
| 217 |
pasticcio = pasticcio.rename(columns={'airport':'airport code','ArrivalAirportEnglish':'destination', 'flight_number':'flight number'})
|
|
@@ -271,6 +271,13 @@ def get_performance():
|
|
| 271 |
global performance_metric
|
| 272 |
return performance_metric
|
| 273 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 274 |
specific_flights = gr.Interface(
|
| 275 |
get_specific_flights,
|
| 276 |
[
|
|
|
|
| 143 |
|
| 144 |
# Make the API request for Swedavia API
|
| 145 |
response = requests.get(swedavia_url, headers = headers)
|
| 146 |
+
response1 = requests.get(swedavia_url1, headers = headers)
|
| 147 |
flights_swedavia = response.json()
|
| 148 |
flights_swedavia1 = response1.json()
|
| 149 |
|
|
|
|
| 211 |
ciccio, pasticcio = pd.DataFrame(), pd.DataFrame()
|
| 212 |
cities_datafram = get_name_of_cities()
|
| 213 |
ciccio = get_today_dataframe()
|
| 214 |
+
ciccio = ciccio.rename(columns={'airport':'airport code', 'ArrivalAirportEnglish':'destination', 'flight_number':'flight number'})
|
| 215 |
today_dataframe = ciccio[selected_columns]
|
| 216 |
pasticcio = get_tomorrow_dataframe()
|
| 217 |
pasticcio = pasticcio.rename(columns={'airport':'airport code','ArrivalAirportEnglish':'destination', 'flight_number':'flight number'})
|
|
|
|
| 271 |
global performance_metric
|
| 272 |
return performance_metric
|
| 273 |
|
| 274 |
+
|
| 275 |
+
'''
|
| 276 |
+
print(get_specific_flights('today', 100, 8, 'am', 'weather', ['Select all'], 'yes'))
|
| 277 |
+
print(full_day_departure('tomorrow'))
|
| 278 |
+
print(get_performance())
|
| 279 |
+
'''
|
| 280 |
+
|
| 281 |
specific_flights = gr.Interface(
|
| 282 |
get_specific_flights,
|
| 283 |
[
|