Skip to content

rename_dims to an existing dimension name #4093

Description

@dcherian
ds = xr.Dataset({"a": ("x", np.arange(10)), "b": ("y", np.arange(10))})
ds.rename_dims({"x": "y"})
ValueError: Cannot rename x to y because y already exists. Try using swap_dims instead.

This should be possible since both x and y have the same lengths.
Thoughts?

For indexed dimensions, should we check that the indexes are equal?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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