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
Both DataFrameGroupBy.filter and SeriesGroupBy.filter state that they "filter elements from groups".
This is not true, these methods filter whole groups. If you attempt to filter individual elements within a group by returning a series of boolean you get an error:
After looking at this again, I think the documentation does make sense but I was misinterpreting it. This does filter out rows/elements rather than whole groups, but it filters rows based on a criterion that applies to the whole group rather than to rows within the group.
Pandas version checks
main
hereLocation of the documentation
https://pandas.pydata.org/docs/reference/api/pandas.core.groupby.DataFrameGroupBy.filter.html and https://pandas.pydata.org/docs/reference/api/pandas.core.groupby.SeriesGroupBy.filter.html
Documentation problem
Both
DataFrameGroupBy.filter
andSeriesGroupBy.filter
state that they "filter elements from groups".This is not true, these methods filter whole groups. If you attempt to filter individual elements within a group by returning a series of boolean you get an error:
Suggested fix for documentation
Suggested documentation:
The text was updated successfully, but these errors were encountered: