Unfortunately, the function comes from somewhere else and is supposed to operate on values, not indices.
Actually, if you do this, you probably do want to use filter instead:
as then you don’t need to worry about indexing back into your vector of indices.
Normally, I would, of course. But in this case, i want the indices: The result is a data selector for a another large dataset (big entries). Have to avoid copies, and data may be out-of-core.
I’m filtering the keys of the collection, not the values. Even if it’s an opaque function, this should just work. You can also customize which kinds of keys you get back (linear or Cartesian), for example: