Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
import pandas as pd
|
|
|
4 |
|
5 |
from gluonts.dataset.pandas import PandasDataset
|
6 |
from gluonts.dataset.split import split
|
@@ -62,6 +63,11 @@ def train_and_forecast(
|
|
62 |
new_df = df.reindex(date_range)
|
63 |
new_df = new_df.interpolate(method='spline', order=2)
|
64 |
print(new_df)
|
|
|
|
|
|
|
|
|
|
|
65 |
gluon_df = PandasDataset(new_df, target=new_df.columns[0], freq=freq)
|
66 |
print(gluon_df)
|
67 |
row_offset = offset_calculation(prediction_length, rolling_windows, len(df))
|
|
|
1 |
import os
|
2 |
import gradio as gr
|
3 |
import pandas as pd
|
4 |
+
import io
|
5 |
|
6 |
from gluonts.dataset.pandas import PandasDataset
|
7 |
from gluonts.dataset.split import split
|
|
|
63 |
new_df = df.reindex(date_range)
|
64 |
new_df = new_df.interpolate(method='spline', order=2)
|
65 |
print(new_df)
|
66 |
+
# trying this hack to fix pandas beginMonth stuff
|
67 |
+
buffer = io.BytesIO()
|
68 |
+
new_df.to_csv(buffer)
|
69 |
+
buffer.seek(0)
|
70 |
+
new_df = pd.read_csv(buffer)
|
71 |
gluon_df = PandasDataset(new_df, target=new_df.columns[0], freq=freq)
|
72 |
print(gluon_df)
|
73 |
row_offset = offset_calculation(prediction_length, rolling_windows, len(df))
|