@classmethod<EOL><INDENT>def from_range(cls, data, name=None, dtype=None, **kwargs):<DEDENT>
if not isinstance(data, range):<EOL><INDENT>raise TypeError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>'.format(cls.__name__, repr(data)))<EOL><DEDENT>start, stop, step = data.start, data.stop, data.step<EOL>return RangeIndex(start, stop, step, dtype=dtype, name=name, **kwargs)<EOL>
Create RangeIndex from a range object.