From 8383d3bea6ea2e70399abbbadeffeee75edd9d60 Mon Sep 17 00:00:00 2001 From: bl Date: Tue, 4 Jul 2017 00:26:22 -0700 Subject: [PATCH] Check for NULL in ds column --- python/fbprophet/forecaster.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/fbprophet/forecaster.py b/python/fbprophet/forecaster.py index c4fa17e..01ae798 100644 --- a/python/fbprophet/forecaster.py +++ b/python/fbprophet/forecaster.py @@ -174,6 +174,8 @@ class Prophet(object): if 'y' in df: df['y'] = pd.to_numeric(df['y']) df['ds'] = pd.to_datetime(df['ds']) + if df['ds'].isnull().any(): + raise ValueError('Found NaN in column ds.') df = df.sort_values('ds') df.reset_index(inplace=True, drop=True)