Skip to content

Improve naming and standardize functionality of .reset_index() and .reset_coords() methods #4366

Open
@rchurt

Description

@rchurt

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 as Pandas .reset_index(), namely to make an index of ints from 0 to nrows
  • Make a new method called .reset_coords() that has an analagous function to Pandas .reset_index(), but for coords, namely to make an coordinate of ints from 0 to the length of that coordinate

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions