Circhastic commited on
Commit
5c50e05
1 Parent(s): be25e64

Update app

Browse files
Files changed (1) hide show
  1. app.py +18 -1
app.py CHANGED
@@ -281,6 +281,23 @@ if (st.session_state.uploaded):
281
  future_lower_series = pd.Series(confint[:, 0], index=future_index_of_fc)
282
  future_upper_series = pd.Series(confint[:, 1], index=future_index_of_fc)
283
 
 
 
 
 
 
 
 
284
  auto_sales_growth = sales_growth(df, future_fitted_series)
 
 
 
 
 
285
  st.write("Forecasted sales in the next 3 months")
286
- st.write(auto_sales_growth)
 
 
 
 
 
 
281
  future_lower_series = pd.Series(confint[:, 0], index=future_index_of_fc)
282
  future_upper_series = pd.Series(confint[:, 1], index=future_index_of_fc)
283
 
284
+
285
+ # Streamlit plot
286
+ st.title("Final Forecast of Retail Sales")
287
+ st.line_chart(df['Sales'][-50:])
288
+ st.line_chart(future_fitted_series, use_container_width=True, key='fitted_chart')
289
+ st.area_chart(pd.concat([future_lower_series, future_upper_series], axis=1), key='confidence_interval_chart')
290
+
291
  auto_sales_growth = sales_growth(df, future_fitted_series)
292
+ df = auto_sales_growth
293
+ df = df.reset_index()
294
+ df['Date'] = df['Date'].dt.strftime('%B %d, %Y')
295
+ df[df.columns] = df[df.columns].astype(str)
296
+
297
  st.write("Forecasted sales in the next 3 months")
298
+ st.write(df)
299
+
300
+
301
+ question = st.text_input('Ask a Question about the Forecasted Data', placeholder="What is the total sales in the month of December?")
302
+ answer = get_converted_answer(df, question)
303
+ st.write('The answer for that is:', answer)