def _to_m8(key):
 if (not isinstance(key, Timedelta)):
  key = Timedelta(key)
 return np.int64(key.value).view(_TD_DTYPE)

def _to_m8 ( key ) : if ( not isinstance ( key , Timedelta ) ) : key = Timedelta ( key ) return np . int64 ( key . value ) . view ( _TD_DTYPE )
timestamp-like => dt64 .