Пример #1
0
 def from_tuples(cls, data, closed='right', name=None, copy=False,
                 dtype=None):
     with rewrite_exception("IntervalArray", cls.__name__):
         arr = IntervalArray.from_tuples(data, closed=closed, copy=copy,
                                         dtype=dtype)
     return cls._simple_new(arr, name=name)
Пример #2
0
 def from_arrays(cls, left, right, closed='right', name=None, copy=False,
                 dtype=None):
     with rewrite_exception("IntervalArray", cls.__name__):
         array = IntervalArray.from_arrays(left, right, closed, copy=copy,
                                           dtype=dtype)
     return cls._simple_new(array, name=name)
Пример #3
0
 def where(self, cond, other=None):
     if other is None:
         other = self._na_value
     values = np.where(cond, self._values, other)
     result = IntervalArray(values)
     return self._shallow_copy(result)
Пример #4
0
 def where(self, cond, other=None):
     if other is None:
         other = self._na_value
     values = np.where(cond, self._values, other)
     result = IntervalArray(values)
     return type(self)._simple_new(result, name=self.name)
Пример #5
0
 def from_tuples(cls, data, closed='right', name=None, copy=False,
                 dtype=None):
     with rewrite_exception("IntervalArray", cls.__name__):
         arr = IntervalArray.from_tuples(data, closed=closed, copy=copy,
                                         dtype=dtype)
     return cls._simple_new(arr, name=name)
Пример #6
0
 def from_arrays(cls, left, right, closed='right', name=None, copy=False,
                 dtype=None):
     with rewrite_exception("IntervalArray", cls.__name__):
         array = IntervalArray.from_arrays(left, right, closed, copy=copy,
                                           dtype=dtype)
     return cls._simple_new(array, name=name)