mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-07-30 20:18:11 +00:00
If ds column is int, convert to str before pd.to_datetime to avoid nanosecond casting (#675)
This commit is contained in:
parent
4e5e223e4f
commit
26f60c0a49
1 changed files with 2 additions and 0 deletions
|
|
@ -236,6 +236,8 @@ class Prophet(object):
|
|||
df['y'] = pd.to_numeric(df['y'])
|
||||
if np.isinf(df['y'].values).any():
|
||||
raise ValueError('Found infinity in column y.')
|
||||
if df['ds'].dtype == np.int64:
|
||||
df['ds'] = df['ds'].astype(str)
|
||||
df['ds'] = pd.to_datetime(df['ds'])
|
||||
if df['ds'].isnull().any():
|
||||
raise ValueError('Found NaN in column ds.')
|
||||
|
|
|
|||
Loading…
Reference in a new issue