Improve naming and standardize functionality of .reset_index() and .reset_coords() methods
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.2k
- Forks
- 1.4k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 14
Description
Is your feature request related to a problem? Please describe.
I think that the behavior of the .reset_index() and .reset_coords() methods is a bit non-intuitive, especially when coming to xarray from Pandas.
Describe the solution you'd like
One proposal is this:
- Change the name of
.reset_index()to.index_to_coords(), because it seems like this is what the method really does - Change the name of
.reset_coords()to.coords_to_vars(), because it seems like this is what the method really does - Make a new method called
.reset_index()that has the same function asPandas.reset_index(), namely to make an index ofints from 0 tonrows - Make a new method called
.reset_coords()that has an analagous function toPandas.reset_index(), but forcoords, namely to make ancoordinateofints from 0 to the length of that coordinate
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing xarray's existing .reset_index() and .reset_coords() methods, then compare their behavior with the linked Pandas .reset_index() documentation. The proposal is complete only after the naming changes and new index/coordinate-reset semantics are agreed and consistently implemented; no source files or tests are identified in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- pandas, python
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100