Skip to content

Instantly share code, notes, and snippets.

@Cadair
Created October 1, 2024 11:39
Show Gist options
  • Save Cadair/4a03750868e044ac4bdd6f3a04ed7abc to your computer and use it in GitHub Desktop.
Save Cadair/4a03750868e044ac4bdd6f3a04ed7abc to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@benbovy
Copy link

benbovy commented Oct 2, 2024

Instead of

coords = xr.Coordinates(coords=index.create_variables())

you should do

coords = xr.Coordinates(coords=index.create_coords())

so the coordinates of the Dataset have an attached index (enabling those coordinates to be used with ds.sel(...), xr.align(ds), etc.).

@Cadair
Copy link
Author

Cadair commented Oct 2, 2024

Thanks @benbovy I think I swapped from that to variables while blindling poking at the repr issue.

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