pydata / pydata/xarray

Change `swap_dims` to rename_dims?

Open
#2,838 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
4.2k
Forks
1.4k
Avg merge
2d 15h
Merged PRs (30d)
14

Description

Basically I'm trying to swap the names and data (basically the underlying numpy array would be the same, but the coords would change) of two dimensions in my DataArray and I was looking for options that could do that.

So I thought swap_dims would be a good candidate for that given its description but it doesn't work. In fact, based on the docs, I have no idea how to use it and what it does. Based off of issues like this it seems I'm not alone.

Maybe it would be good to add example of usage of this function?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing swap_dims documentation and its DataArray usage; the issue says the current description does not explain how the function works. Add a concrete example that clarifies its behavior and coordinate changes, and consider the naming question raised in the title. Done means a newcomer can understand when and how to use swap_dims.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.