示例#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
示例#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
示例#3
0
文件: period.py 项目: bkandel/pandas
    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)
示例#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)
示例#5
0
 def _time_shift(self, periods, freq=None):
     result = DatetimeLikeArrayMixin._time_shift(self, periods, freq=freq)
     result.name = self.name
     return result
示例#6
0
 def _time_shift(self, periods, freq=None):
     result = DatetimeLikeArrayMixin._time_shift(self, periods, freq=freq)
     result.name = self.name
     return result