Spaces:
Runtime error
Runtime error
Commit ·
a6043ed
1
Parent(s): a07de77
Update app.py
Browse files1 unmodified line234567891011121314151 unmodified lineimport numpy as npimport pandas as pdimport plotly.express as pxuploaded_file = st.file_uploader("Choose a CSV file", accept_multiple_files=False)if uploaded_file is not None:# Can be used wherever a "file-like" object is accepted:dataframe = pd.read_csv(uploaded_file)st.write(dataframe)series = st.text_input("Write the name of the variable you want to forecast")dataframe['time'] = dataframe.indexif series is not None:fig = px.line(dataframe, x='time', y=series, title=f'Forecasting {series}')st.plotly_chart(fig)1 unmodified line234567891011121314151617181920212223242526271 unmodified lineimport numpy as npimport pandas as pdimport plotly.express as pxfrom statsforecast import StatsForecastfrom statsforecast.models import seasonal_naive, auto_arimast.title('Forecasting time series')uploaded_file = st.file_uploader("Choose a CSV file", accept_multiple_files=False)if uploaded_file is not None:dataframe = pd.read_csv(uploaded_file)st.write(dataframe)series = st.text_input("Write the name of the variable you want to forecast")date = st.text_input("Write the first date")freq = st.text_input("Write the frequency")if series is not None:series_train = pd.DataFrame({'ds': pd.date_range(start=date, periods=dataframe.shape[0], freq=freq),'y': dataframe[series]},index=pd.Index([0] * dataframe.shape[0], name='unique_id'))fig = px.line(series_train, x='ds', y='y', title=f'{series}')st.plotly_chart(fig)
app.py+16-4