Benoit Bovy
Benoit Bovy
Actually, if `pd.RangeIndex` doesn't store the whole array I think it is possible to directly subclass `xarray.indexes.PandasIndex` and implement the extra logic in `.from_variables()` to create a `pd.RangeIndex` instance before...
Prototype of a `RangeIndex` based on a `pandas.RangeIndex`: [notebook](https://notebooksharing.space/view/37a45e01bbfe69d4242808ef9e88bf3dbcbd297d0221493fc4a4ae77e980e809#displayOptions=) It doesn't really do much apart from supporting multiple ways to set the index from different kinds of coordinates. The rest...
I think this occurs in the case of fancy indexing of an xarray object (i.e., provide another DataArray as indexer argument to `isel`) where the same coordinate name is found...
Sorry @carschandler if you feel that my https://github.com/pydata/xarray/pull/8332#discussion_r1366593050 was dismissive, it wasn't intended to be so. I definitely don't want to discourage anyone making suggestions / contributions to improve Xarray,...
> I've been starting to think of multiindex as a model for a user defined custom index wrapping multiple variables. Yes this is a good model. That's what causes a...
Auto-promoting dimension data variables as dimension coordinates when creating a new Dataset has been indeed the expected behavior so far. I'm not sure what best we should do, though. On...
That looks like a nice solution @keewis, except maybe `xr.Dataset(data_vars={"x": [0]})` not creating an "x" coordinate, which would be a breaking change (in theory) and which would require another deprecation...
In theory we could implement some logic in the xarray `PandasIndex` wrapper such that it departs from `pandas.Index`, although I don't think it is always a good idea. In this...
This is still relevant. As part of the ongoing explicit / flexible indexes refactoring, we'll probably need a more general solution to pass any selection option to the corresponding indexes.
> perhaps an adaptation of reindex rather than sel? I think this would make more sense indeed. Similarly to [advanced indexing](https://docs.xarray.dev/en/latest/user-guide/indexing.html#more-advanced-indexing), advanced reindexing might perhaps be done by passing xarray...