DEPR: deprecate .select() by jreback · Pull Request #17633 · pandas-dev/pandas (original) (raw)
Well, we already have this ability to accept pretty arbitrary things for .loc callables.
It is not arbitrary, it is the calling object (series of frame). Which is clearly different from the index elements.
Yes its pretty fragile. I think removing this logic and simply deprecating .select entirely is an option.
I would personally go for that, instead of adding this fragile logic
There are still 'alternatives' to offer, although a bit more work to type. Eg:
s.loc[s.index.map(f).values]
it's only a bit annoying that you need the .values
(and there are maybe others I don't think of)
We could also add the 'function' ability to filter
..