mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-07-30 20:18:11 +00:00
Deduplicate history dates for make_future_dataframe
This commit is contained in:
parent
6ec0a90a60
commit
fb6552137c
2 changed files with 2 additions and 2 deletions
|
|
@ -1148,7 +1148,7 @@ fit.prophet <- function(m, df, ...) {
|
|||
if (nrow(history) < 2) {
|
||||
stop("Dataframe has less than 2 non-NA rows.")
|
||||
}
|
||||
m$history.dates <- sort(set_date(df$ds))
|
||||
m$history.dates <- sort(set_date(unique(df$ds)))
|
||||
|
||||
out <- setup_dataframe(m, history, initialize_scales = TRUE)
|
||||
history <- out$df
|
||||
|
|
|
|||
|
|
@ -1106,7 +1106,7 @@ class Prophet(object):
|
|||
history = df[df['y'].notnull()].copy()
|
||||
if history.shape[0] < 2:
|
||||
raise ValueError('Dataframe has less than 2 non-NaN rows.')
|
||||
self.history_dates = pd.to_datetime(df['ds']).sort_values()
|
||||
self.history_dates = pd.to_datetime(df['ds'].unique()).sort_values()
|
||||
|
||||
history = self.setup_dataframe(history, initialize_scales=True)
|
||||
self.history = history
|
||||
|
|
|
|||
Loading…
Reference in a new issue