Mei000 commited on
Commit
dcbd89a
·
1 Parent(s): 38615d1

Update functions.py

Browse files
Files changed (1) hide show
  1. functions.py +0 -32
functions.py CHANGED
@@ -62,38 +62,6 @@ def get_model(project, model_name, evaluation_metric, sort_metrics_by):
62
 
63
  return model
64
 
65
-
66
- def get_air_quality_data(station_name):
67
- AIR_QUALITY_API_KEY = os.getenv('AIR_QUALITY_API_KEY')
68
- request_value = f'https://api.waqi.info/feed/{station_name}/?token={AIR_QUALITY_API_KEY}'
69
- answer = requests.get(request_value).json()["data"]
70
- forecast = answer['forecast']['daily']
71
- return [
72
- answer["time"]["s"][:10], # Date
73
- int(forecast['pm25'][0]['avg']), # avg predicted pm25
74
- int(forecast['pm10'][0]['avg']), # avg predicted pm10
75
- max(int(forecast['pm25'][0]['avg']), int(forecast['pm10'][0]['avg'])) # avg predicted aqi
76
- ]
77
-
78
- def get_air_quality_df(data):
79
- col_names = [
80
- 'date',
81
- 'pm25',
82
- 'pm10',
83
- 'aqi'
84
- ]
85
-
86
- new_data = pd.DataFrame(
87
- data
88
- ).T
89
- new_data.columns = col_names
90
- new_data['pm25'] = pd.to_numeric(new_data['pm25'])
91
- new_data['pm10'] = pd.to_numeric(new_data['pm10'])
92
- new_data['aqi'] = pd.to_numeric(new_data['aqi'])
93
-
94
- print(new_data)
95
- return new_data
96
-
97
 
98
  def get_weather_data_weekly(city: str, start_date: datetime) -> pd.DataFrame:
99
  #WEATHER_API_KEY = os.getenv('WEATHER_API_KEY')
 
62
 
63
  return model
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
  def get_weather_data_weekly(city: str, start_date: datetime) -> pd.DataFrame:
67
  #WEATHER_API_KEY = os.getenv('WEATHER_API_KEY')