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)
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)
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)
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)