Fix uncommon column case issue for fbprophet

'date' was sometimes 'Date'
This commit is contained in:
Aaron Cutright
2021-03-15 20:51:14 -04:00
parent ab2474210e
commit bfad63e693

View File

@@ -95,6 +95,7 @@ def fbprophet(l_args, s_ticker, df_stock):
df_stock = df_stock.sort_index(ascending=True)
df_stock.reset_index(level=0, inplace=True)
df_stock.columns = map(str.lower, df_stock.columns) # column names are sometimes upper cased
df_stock = df_stock[["date", "5. adjusted close"]]
df_stock = df_stock.rename(columns={"date": "ds", "5. adjusted close": "y"})
df_stock["ds"] = pd.to_datetime(df_stock["ds"])