pandas.RangeIndex.step — pandas 3.0.0rc0+52.gb43b95d2b4 documentation (original) (raw)

property RangeIndex.step[source]#

The value of the step parameter (1 if this was not supplied).

The step parameter determines the increment (or decrement in the case of negative values) between consecutive elements in the RangeIndex.

Examples

idx = pd.RangeIndex(5) idx.step 1

idx = pd.RangeIndex(2, -10, -3) idx.step -3

Even if pandas.RangeIndex is empty, step is still 1 if not supplied.

idx = pd.RangeIndex(1, 0) idx.step 1