Spaces:
Sleeping
Sleeping
mattritchey
commited on
Update main.py
Browse files
main.py
CHANGED
@@ -76,10 +76,11 @@ def get_hail_data(lat, lon, start_date, end_date, radius_miles, get_max):
|
|
76 |
data_max = np.max(data_mat, axis=(1, 2))
|
77 |
df_data = pd.DataFrame({'Date': dates_all,
|
78 |
'Hail_max': data_max})
|
|
|
79 |
else:
|
80 |
data_all = list(data_mat)
|
81 |
df_data = pd.DataFrame({'Date': dates_all,
|
82 |
-
'Hail_all':
|
83 |
|
84 |
df_data['Date'] = pd.to_datetime(df_data['Date'], format='%Y%m%d')
|
85 |
df_data = df_data.set_index('Date')
|
@@ -101,3 +102,4 @@ async def predict(lat: float, lon: float, start_date: str, end_date: str, radius
|
|
101 |
results = pd.DataFrame({'Date': ['error'], 'Hail_max': ['error']})
|
102 |
|
103 |
return results.to_json()
|
|
|
|
76 |
data_max = np.max(data_mat, axis=(1, 2))
|
77 |
df_data = pd.DataFrame({'Date': dates_all,
|
78 |
'Hail_max': data_max})
|
79 |
+
# Get all Data
|
80 |
else:
|
81 |
data_all = list(data_mat)
|
82 |
df_data = pd.DataFrame({'Date': dates_all,
|
83 |
+
'Hail_all': data_all})
|
84 |
|
85 |
df_data['Date'] = pd.to_datetime(df_data['Date'], format='%Y%m%d')
|
86 |
df_data = df_data.set_index('Date')
|
|
|
102 |
results = pd.DataFrame({'Date': ['error'], 'Hail_max': ['error']})
|
103 |
|
104 |
return results.to_json()
|
105 |
+
|