Skip to content

Commit

Permalink
feat(pandas): implement NotContains on grouped data
Browse files Browse the repository at this point in the history
  • Loading branch information
cpcloud committed Aug 2, 2022
1 parent 29ad5f4 commit 976dce7
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ibis/backends/pandas/execution/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,17 @@ def execute_node_not_contains_series_sequence(op, data, elements, **kwargs):
return ~(data.isin(elements))


@execute_node.register(
ops.NotContains,
SeriesGroupBy,
(collections.abc.Sequence, collections.abc.Set, pd.Series),
)
def execute_node_not_contains_series_group_by_sequence(
op, data, elements, **kwargs
):
return (~data.obj.isin(elements)).groupby(data.grouper.groupings)


# Series, Series, Series
# Series, Series, scalar
@execute_node.register(ops.Where, pd.Series, pd.Series, pd.Series)
Expand Down

0 comments on commit 976dce7

Please sign in to comment.