Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Make public `start`, `stop` and `step` attributes for RangeIndex #25710
This may be useful to downstream projects (e.g. apache/arrow#3868).
Initially, I think the idea was for RangeIndex to be a drop-in optimized replacement for the equivalent Int64Index. Other libraries might want public access to the same optimizations.
+1, this would additionally make
In : rng = range(2, 11, 3) In : rng.start Out: 2 In : rng.stop Out: 11 In : rng.step Out: 3
Will open a PR for this later tonight.
Personally, I am not really sure we need them (if downstream projects that need it are fine with using the private ones, we can guarantee there stability).
From a user perspective, I think the idea was to have it as a drop in replacement for int index. And you also quickly loose the presence of the RangeIndex, eg by doing a filtering operation, and then at once those attributes don't exist anymore.
But not feeling strongly about it (it's maybe just I would rather see dataframes with an optional index :))
referenced this issue
Mar 14, 2019
@jorisvandenbossche : I opened a PR to implement this, but I don't have strong feelings either way. Been having power/internet issues today due to a storm, so didn't see the notification for your comment until I basically had all the content of the PR complete. Wouldn't be offended if the PR gets closed.