-
-
Notifications
You must be signed in to change notification settings - Fork 19.2k
DEPR: rename filter->select #62684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
DEPR: rename filter->select #62684
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My preference here would be to remove the axis
argument and have select only operate on columns, which would agree with PySpark and Polars. We could point users to using .loc
for operating on rows (regex and like can be done via boolean masks as well). But I won't block on this.
:meth:`Series.select` and :meth:`DataFrame.select` | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
The ``filter`` method is used to select a subset of rows that match certain criteria. | ||
:meth:`Series.filter` and :meth:`DataFrame.filter` do not support user defined functions, | ||
The ``select`` method is used to select a subset of rows that match certain criteria. | ||
:meth:`Series.select` and :meth:`DataFrame.select` do not support user defined functions, | ||
but :meth:`SeriesGroupBy.filter` and :meth:`DataFrameGroupBy.filter` do. You can read more | ||
about ``filter`` in groupby operations in :ref:`groupby.filter`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section was really about groupby's filter (which is already filter-y). We only gave a head nod to other filters just because they had the same name so as not to cause confusion. Can we either just add that Series.filter
and DataFrame.filter
are deprecated or remove the lines about Series.filter
and DataFrame.filter
entirely.
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.cc @jorisvandenbossche want to make sure this doesn't catch you by surprise. To avoid API bikeshedding, this just renames filter->select without futzing with the signature etc. AFAICT the real benefit is going to be in freeing up "filter" to be eventually re-implemented to be actually filter-y.