Skip to content

fix: Empty RangeIndex Display#10594

Merged
dcherian merged 3 commits intopydata:mainfrom
ianhi:10547-rangeindex-empty-slice
Aug 13, 2025
Merged

fix: Empty RangeIndex Display#10594
dcherian merged 3 commits intopydata:mainfrom
ianhi:10547-rangeindex-empty-slice

Conversation

@ianhi
Copy link
Collaborator

@ianhi ianhi commented Aug 1, 2025

Semi following @anntzer's helpful suggestion of changing internal definition.

I didn't add the suggestion about [::2] to change the step size because I don't see how that would work give start, stop and size defined else where.

ianhi and others added 2 commits July 31, 2025 20:36
Following @anntzer's suggestion of changing internal definition
- Add explicit type checks with isinstance() before accessing RangeIndex.step
- Improves type safety and test robustness for issue pydata#10547

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Copy link
Member

@benbovy benbovy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @ianhi!

@dcherian dcherian enabled auto-merge (squash) August 13, 2025 01:24
@dcherian dcherian merged commit e8b41fe into pydata:main Aug 13, 2025
37 checks passed
@ianhi ianhi deleted the 10547-rangeindex-empty-slice branch August 13, 2025 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty slice of DataArray with RangeIndex coordinate is unprintable

4 participants