ENH: rank() should return 0 indexed values for consistency #46964
Labels
Algos
Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
API Design
Enhancement
Needs Discussion
Requires discussion from core team before further action
Is your feature request related to a problem?
I am using pandas for a ranking task. The default series.rank() method returns ranks that starts at 1 instead of 0. Thus breaking some unexpected stuff if assuming 0 indexed result, as is common in python.
Describe the solution you'd like
Series.rank() should return 0 indexed values.
API breaking implications
Breaking existing code that rely on 1-indexed ranks
Describe alternatives you've considered
Shifting the output by -1 is the obvious solution, but feels weird.
The text was updated successfully, but these errors were encountered: