code: def _dt_to_float_ordinal(dt):
      
      if (isinstance(dt, (np.ndarray, Index, ABCSeries)
                     ) and is_datetime64_ns_dtype(dt)):
          base = dates.epoch2num(dt.asi8 / 1.0E9)
      else:
          base = dates.date2num(dt)
      return base
docs: Convert :mod:`datetime` to the Gregorian date as UTC float days,
      preserving hours, minutes, seconds and microseconds.  Return value
      is a :func:`float`.