Exemple #1
0
 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
Exemple #2
0
 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
Exemple #3
0
    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)
Exemple #4
0
    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)
Exemple #5
0
 def _time_shift(self, periods, freq=None):
     result = DatetimeLikeArrayMixin._time_shift(self, periods, freq=freq)
     result.name = self.name
     return result
Exemple #6
0
 def _time_shift(self, periods, freq=None):
     result = DatetimeLikeArrayMixin._time_shift(self, periods, freq=freq)
     result.name = self.name
     return result