Don't allow timezones in pandas datetime

This commit is contained in:
Ben Letham 2019-05-13 15:00:45 -07:00
parent df6bef8920
commit f660264e23

View file

@ -239,6 +239,11 @@ class Prophet(object):
if df['ds'].dtype == np.int64:
df['ds'] = df['ds'].astype(str)
df['ds'] = pd.to_datetime(df['ds'])
if df['ds'].dt.tz is not None:
raise ValueError(
'Column ds has timezone specified, which is not supported. '
'Remove timezone.'
)
if df['ds'].isnull().any():
raise ValueError('Found NaN in column ds.')
for name in self.extra_regressors: