mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-18 08:53:42 +00:00
Don't allow timezones in pandas datetime
This commit is contained in:
parent
df6bef8920
commit
f660264e23
1 changed files with 5 additions and 0 deletions
|
|
@ -239,6 +239,11 @@ class Prophet(object):
|
||||||
if df['ds'].dtype == np.int64:
|
if df['ds'].dtype == np.int64:
|
||||||
df['ds'] = df['ds'].astype(str)
|
df['ds'] = df['ds'].astype(str)
|
||||||
df['ds'] = pd.to_datetime(df['ds'])
|
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():
|
if df['ds'].isnull().any():
|
||||||
raise ValueError('Found NaN in column ds.')
|
raise ValueError('Found NaN in column ds.')
|
||||||
for name in self.extra_regressors:
|
for name in self.extra_regressors:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue