Beispiel #1
0
 def from_tuples(cls,
                 data,
                 closed: str = "right",
                 name=None,
                 copy: bool = 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)
Beispiel #2
0
    def from_tuples(
        cls,
        data,
        inclusive: IntervalInclusiveType | None = None,
        name: Hashable = None,
        copy: bool = False,
        dtype: Dtype | None = None,
    ) -> IntervalIndex:

        if inclusive is None:
            inclusive = "right"

        with rewrite_exception("IntervalArray", cls.__name__):
            arr = IntervalArray.from_tuples(data,
                                            inclusive=inclusive,
                                            copy=copy,
                                            dtype=dtype)
        return cls._simple_new(arr, name=name)
Beispiel #3
0
    def from_tuples(
        cls,
        data,
        inclusive=None,
        closed: None | lib.NoDefault = lib.no_default,
        name: Hashable = None,
        copy: bool = False,
        dtype: Dtype | None = None,
    ) -> IntervalIndex:

        inclusive, closed = _warning_interval(inclusive, closed)
        if inclusive is None:
            inclusive = "both"

        with rewrite_exception("IntervalArray", cls.__name__):
            arr = IntervalArray.from_tuples(
                data, inclusive=inclusive, copy=copy, dtype=dtype
            )
        return cls._simple_new(arr, name=name)
Beispiel #4
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)