Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,10 +41,13 @@ def plot_raw_data():
|
|
| 41 |
|
| 42 |
plot_raw_data()
|
| 43 |
|
| 44 |
-
# Predict forecast with Prophet.
|
| 45 |
df_train = data[['Date', 'Close']]
|
| 46 |
df_train = df_train.rename(columns={"Date": "ds", "Close": "y"})
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
m = Prophet()
|
| 49 |
m.fit(df_train)
|
| 50 |
future = m.make_future_dataframe(periods=periods)
|
|
|
|
| 41 |
|
| 42 |
plot_raw_data()
|
| 43 |
|
|
|
|
| 44 |
df_train = data[['Date', 'Close']]
|
| 45 |
df_train = df_train.rename(columns={"Date": "ds", "Close": "y"})
|
| 46 |
|
| 47 |
+
# Check and handle non-numeric values in 'y' column
|
| 48 |
+
df_train['y'] = pd.to_numeric(df_train['y'], errors='coerce') # Convert non-numeric to NaN
|
| 49 |
+
df_train = df_train.dropna() # Drop rows with NaN values in 'y'
|
| 50 |
+
|
| 51 |
m = Prophet()
|
| 52 |
m.fit(df_train)
|
| 53 |
future = m.make_future_dataframe(periods=periods)
|