@@ -260,7 +260,7 @@ def _simple_new(cls, left, right, closed=None, name=None, copy=False,
260260 right = _ensure_index (right , copy = copy )
261261
262262 if dtype is not None :
263- # GH 19262
263+ # GH 19262: dtype must be an IntervalDtype to override inferred
264264 dtype = pandas_dtype (dtype )
265265 if not is_interval_dtype (dtype ):
266266 msg = 'dtype must be an IntervalDtype, got {dtype}'
@@ -574,7 +574,7 @@ def from_tuples(cls, data, closed='right', name=None, copy=False,
574574
575575 Examples
576576 --------
577- >>> pd.IntervalIndex.from_tuples([(0, 1), (1,2)])
577+ >>> pd.IntervalIndex.from_tuples([(0, 1), (1, 2)])
578578 IntervalIndex([(0, 1], (1, 2]],
579579 closed='right', dtype='interval[int64]')
580580
@@ -596,6 +596,7 @@ def from_tuples(cls, data, closed='right', name=None, copy=False,
596596 lhs = rhs = np .nan
597597 else :
598598 try :
599+ # need list of length 2 tuples, e.g. [(0, 1), (1, 2), ...]
599600 lhs , rhs = d
600601 except ValueError :
601602 msg = ('IntervalIndex.from_tuples requires tuples of '
0 commit comments