class_docstr: Integration with the Nixtla TimeGPT models for
  zero-shot time series forecasting.
class_docstr_tok: ["Integration","with","the","Nixtla","TimeGPT","models","for","zero-shot","time","series","forecasting","."]
code: def _convert_to_iso(df, date_column):
      # whether values in date_column are numeric (Unix timestamp) or string (date)
      if pd.api.types.is_numeric_dtype(df[date_column]):
          unit = ""
          # ascending unit order
          for u in ["ns", "us", "ms", "s"]:
              mindate = pd.to_datetime(
                  df[date_column].min(), unit=u, origin="unix"
              )
              maxdate = pd.to_datetime(
                  df[date_column].max(), unit=u, origin="unix"
              )
              if mindate > pd.to_datetime(
                  "1970-01-01T00:00:00"
              ) and maxdate < pd.to_datetime("2050-12-31T23:59:59"):
                  unit = u
          df[date_column] = pd.to_datetime(
              df[date_column], unit=unit, origin="unix"
          )
      else:
          df[date_column] = pd.to_datetime(df[date_column])
      df[date_column] = df[date_column].dt.strftime(
          "%Y-%m-%dT%H:%M:%S"
      )  # convert to ISO 8601 format
      df[date_column] = pd.to_datetime(df[date_column])
      return df
  
file_path: mindsdb/mindsdb/integrations/handlers/timegpt_handler/timegpt_handler.py
imports: from typing import Optional, Dict
  import pandas
  from nixtlats import TimeGPT
  from mindsdb.integrations.libs.base import BaseMLEngine
  from mindsdb.integrations.utilities.handler_utils import get_api_key
  from mindsdb.integrations.utilities.time_series_utils import get_results_from_nixtla_df
label_desc: Use image node_id 4 for calling the TimeGPTHandler obj's underlying member method code with example usage: obj._convert_to_iso(df, date_column) and returns: df