Update app.py
Browse files
app.py
CHANGED
@@ -79,10 +79,10 @@ for tab, city in zip(tabs, unique_cities):
|
|
79 |
st.write(f"Non-Seasonal Order: {(p, d, q)}, Seasonal Order: {(P, D, Q, S)}")
|
80 |
forecast_index = pd.date_range(start=city_data.index[-1], periods=7, freq='M')[1:]
|
81 |
forecast_index = forecast_index.to_period('M') # Convert to period index with monthly frequency
|
82 |
-
forecast_df = pd.DataFrame(forecast, columns=['
|
83 |
forecast_df = forecast_df.round(0)
|
84 |
st.table(forecast_df)
|
85 |
-
fig = px.line(forecast_df, x=forecast_df.index, y="
|
86 |
st.plotly_chart(fig)
|
87 |
|
88 |
# Grid search button
|
@@ -119,6 +119,4 @@ for tab, city in zip(tabs, unique_cities):
|
|
119 |
if st.button(f'Export {city} to Excel'):
|
120 |
df_to_export = forecast_df
|
121 |
excel_data = to_excel(df_to_export)
|
122 |
-
st.download_button(label='π₯ Download Excel', data=excel_data, file_name=f'{city}_forecast.xlsx', mime='application/vnd.ms-excel')
|
123 |
-
|
124 |
-
# Rest of your code
|
|
|
79 |
st.write(f"Non-Seasonal Order: {(p, d, q)}, Seasonal Order: {(P, D, Q, S)}")
|
80 |
forecast_index = pd.date_range(start=city_data.index[-1], periods=7, freq='M')[1:]
|
81 |
forecast_index = forecast_index.to_period('M') # Convert to period index with monthly frequency
|
82 |
+
forecast_df = pd.DataFrame(forecast, columns=['predicted_mean'])
|
83 |
forecast_df = forecast_df.round(0)
|
84 |
st.table(forecast_df)
|
85 |
+
fig = px.line(forecast_df, x=forecast_df.index, y="predicted_mean")
|
86 |
st.plotly_chart(fig)
|
87 |
|
88 |
# Grid search button
|
|
|
119 |
if st.button(f'Export {city} to Excel'):
|
120 |
df_to_export = forecast_df
|
121 |
excel_data = to_excel(df_to_export)
|
122 |
+
st.download_button(label='π₯ Download Excel', data=excel_data, file_name=f'{city}_forecast.xlsx', mime='application/vnd.ms-excel')
|
|
|
|