def _evaluate_compare(self, other, op): result = DatetimeLikeArrayMixin._evaluate_compare(self, other, op) if is_bool_dtype(result): return result try: return Index(result) except TypeError: return result
def _add_delta_td(self, other): assert isinstance(self.freq, Tick) # checked by calling function assert isinstance(other, (timedelta, np.timedelta64, Tick)) delta = self._check_timedeltalike_freq_compat(other) # Note: when calling parent class's _add_delta_td, it will call # delta_to_nanoseconds(delta). Because delta here is an integer, # delta_to_nanoseconds will return it unchanged. return DatetimeLikeArrayMixin._add_delta_td(self, delta)
def _time_shift(self, periods, freq=None): result = DatetimeLikeArrayMixin._time_shift(self, periods, freq=freq) result.name = self.name return result