Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change swap_dims to rename_dims? #2838

Open
tomchor opened this issue Mar 21, 2019 · 1 comment
Open

Change swap_dims to rename_dims? #2838

tomchor opened this issue Mar 21, 2019 · 1 comment

Comments

@tomchor
Copy link
Contributor

tomchor commented Mar 21, 2019

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?

@shoyer
Copy link
Member

shoyer commented Mar 23, 2019

swap_dims would probably be better called rename_dims. It replaces one dimension with another on all variables in a Dataset.

@dcherian dcherian changed the title What does swap_dims do? Change swap_dims to rename_dims? Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants