Forum Discussion

pbi_is_ok's avatar
pbi_is_ok
New Member
1 year ago
Solved

AutoML Data Type Error Preventing All Runs

I am trying to use AutoML for the first time (definitely a beginner with machine learning), but I can't even run the basic commands given to me because I run into the same data type error every singl...
  • v-prasare's avatar
    v-prasare
    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 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!