def _dt_to_epoch_ns(dt_series):
 index = pd.to_datetime(dt_series.values)
 if (index.tzinfo is None):
  index = index.tz_localize('UTC')
 else:
  index = index.tz_convert('UTC')
 return index.view(np.int64)

def _dt_to_epoch_ns ( dt_series ) : index = pd . to_datetime ( dt_series . values ) if ( index . tzinfo is None ) : index = index . tz_localize ( 'UTC' ) else : index = index . tz_convert ( 'UTC' ) return index . view ( np . int64 )
convert a timeseries into an int64index of nanoseconds since the epoch .