pandas.RangeIndex.from_range#

classmethod RangeIndex.from_range(data, name=None, dtype=None)[源代码][源代码]#

range 对象创建 pandas.RangeIndex

返回:
RangeIndex

示例

>>> pd.RangeIndex.from_range(range(5))
RangeIndex(start=0, stop=5, step=1)
>>> pd.RangeIndex.from_range(range(2, -10, -3))
RangeIndex(start=2, stop=-10, step=-3)