Comments (5)
Thanks for opening your first issue here at xarray! Be sure to follow the issue template!
If you have an idea for a solution, we would really welcome a Pull Request with proposed changes.
See the Contributing Guide for more.
It may take us a while to respond here, but we really value your contribution. Contributors like you help make xarray better.
Thank you!
from xarray.
IIUC we call this reindex
: https://docs.xarray.dev/en/stable/generated/xarray.Dataset.reindex.html
Do you think the docs for sel
can be improved to point this out?
from xarray.
reindex
is close to the behavior we want, but mandates that the indexer has the same dims as the target.
In this operation, we're indexing along a single dim with a multi-dimensional coord.
So we expect the selection + fill to result in a differently-dimensioned structure.
I've put a gist up at: https://gist.github.com/asford/b10a9f62b3657be7a122b3411e90ba2a
I may not be invoking this correctly, happy to further guidance.
from xarray.
Clarified in description, perhaps an adaptation of reindex
rather than sel
?
The naïve dat.reindex(letter=query.stack(letter=query.dims))
breaks because reindex
ends up replacing the coord index (which we want to preserve) with the indexing values.
from xarray.
perhaps an adaptation of reindex rather than sel?
I think this would make more sense indeed. Similarly to advanced indexing, advanced reindexing might perhaps be done by passing xarray Variable
or DataArray
objects as indexer mapping values to .reindex()
and checking their dimensions. Not sure about the amount of internal refactoring this would require, though.
from xarray.
Related Issues (20)
- Merging coordinates computes array values HOT 2
- Assigning to DataTree.coords should support full paths HOT 3
- A constructor like DataTree.from_dict for data variables and coordinates
- Dask not properly supported when creating binaries with PyInstaller HOT 4
- writing datetime64 in netCDF may produce badly formatted or unreadable files HOT 13
- DataTree: Copy during assignment to child nodes? HOT 2
- Forbid path-like child names
- Why both "backend" and "engine"? HOT 1
- `concat()` very slow when inserting `NaN` into Dask arrays HOT 7
- DataTree repr showing inherited coordinates as non-inherited HOT 1
- Dedicated documentation on Alignment? HOT 2
- Parallelize map_over_subtree HOT 1
- Add a case_sensitivity keyword arguments to methods relying on pathlib (Python 3.12)
- map_blocks fails with lazy loaded dask array
- Performance of deep DataTrees HOT 2
- DataTree.to_zarr(..., compute=True, consolidate=True) fails with `KeyError: '.zmetadata'` on cloud storage HOT 1
- Zarr Python 3 tracking issue HOT 1
- `to_pandas` on `DataArray` with extension array data type
- Progress bar on open_mfdataset HOT 2
- Composite operations on chunked array types not dispatched through chunk manager HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xarray.