Forum Discussion
AutoML Data Type Error Preventing All Runs
- 1 year ago
Hi,
np.datetime64(nan, 'ns') will raise the exact error you're seeing, because NumPy is trying to interpret nan as a timestamp and failing.
You can perform this debugging steps to check for any nulls-print(X[time_col].head())
print(X[time_col].apply(type).value_counts())
print(X[time_col].isnull().sum())This will tell you what data types you actually have in that column.
Then proceed with this-
X[time_col] = pd.to_datetime(X[time_col], errors='coerce')
but make sure to call NumPy and Pandas asimport numpy as np
import pandas as pdHope this helps!
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You!
Hello,
I can confirm with 100% certainty that all of the values within the column are proper date data types and there are no null or missing values, so I don't think that is the issue. Also, it is ambiguous as to which command/cell the suggested code is supposed to be applied to.
Hi,
np.datetime64(nan, 'ns') will raise the exact error you're seeing, because NumPy is trying to interpret nan as a timestamp and failing.
You can perform this debugging steps to check for any nulls-
print(X[time_col].head())
print(X[time_col].apply(type).value_counts())
print(X[time_col].isnull().sum())
This will tell you what data types you actually have in that column.
Then proceed with this-
X[time_col] = pd.to_datetime(X[time_col], errors='coerce')
but make sure to call NumPy and Pandas as
import numpy as np
import pandas as pd
Hope this helps!
If the response has addressed your query, please Accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank You!