You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently .sel() accepts two options method and tolerance. These are relevant for default (pandas) indexes but not necessarily for other, custom indexes.
It would be also useful for custom indexes to expose their own selection options, e.g.,
Or we could simply decide that .sel() should not accept arbitrary options and handle special cases, e.g., via accessors.
It would actually make sense to have something like .my_accessor.sel_k_neighbors(). Not so great to have a separate method just for an optimization option, though.
Activity
benbovy commentedon Sep 28, 2022
Another difficulty regarding multi-coordinate indexes: ideally options should be set per index, not per coordinate.
benbovy commentedon Sep 28, 2022
Or we could simply decide that
.sel()should not accept arbitrary options and handle special cases, e.g., via accessors.It would actually make sense to have something like
.my_accessor.sel_k_neighbors(). Not so great to have a separate method just for an optimization option, though.keewis commentedon Sep 28, 2022
another option would be to allow passing a custom object, like
I think we wanted to have something like that, anyways, to be able to specify other behaviors of a slice, like right-exclusive?
benbovy commentedon Sep 28, 2022
Or use
Indexerobjects to group labels + options? This is slightly different than what you suggest:Let's assume a Dataset with
lat/loncoordinates both sharing the same geographic index + anothertimedimension coordinate, then we could write:This could also be used to avoid code duplication when using common selection options for different indexes.
[-]Pass arbitray options to sel()[/-][+]Pass arbitrary options to sel()[/+]