Check for NULL in ds column

This commit is contained in:
bl 2017-07-04 00:26:22 -07:00
parent f7becb0942
commit 8383d3bea6

View file

@ -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)