@@ -260,7 +260,7 @@ def _simple_new(cls, left, right, closed=None, name=None, copy=False,
260
260
right = _ensure_index (right , copy = copy )
261
261
262
262
if dtype is not None :
263
- # GH 19262
263
+ # GH 19262: dtype must be an IntervalDtype to override inferred
264
264
dtype = pandas_dtype (dtype )
265
265
if not is_interval_dtype (dtype ):
266
266
msg = 'dtype must be an IntervalDtype, got {dtype}'
@@ -574,7 +574,7 @@ def from_tuples(cls, data, closed='right', name=None, copy=False,
574
574
575
575
Examples
576
576
--------
577
- >>> pd.IntervalIndex.from_tuples([(0, 1), (1,2)])
577
+ >>> pd.IntervalIndex.from_tuples([(0, 1), (1, 2)])
578
578
IntervalIndex([(0, 1], (1, 2]],
579
579
closed='right', dtype='interval[int64]')
580
580
@@ -596,6 +596,7 @@ def from_tuples(cls, data, closed='right', name=None, copy=False,
596
596
lhs = rhs = np .nan
597
597
else :
598
598
try :
599
+ # need list of length 2 tuples, e.g. [(0, 1), (1, 2), ...]
599
600
lhs , rhs = d
600
601
except ValueError :
601
602
msg = ('IntervalIndex.from_tuples requires tuples of '
0 commit comments