Skip to content

Commit

Permalink
pass include_groups=False to DataFrameGroupBy.apply
Browse files Browse the repository at this point in the history
  • Loading branch information
ludwiglierhammer committed Oct 16, 2024
1 parent b793aa1 commit 15b1cee
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cdm_reader_mapper/cdm_mapper/duplicates.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,12 @@ def _get_duplicates(x, last):
indexes_df[keep_] = indexes_df[keep_].replace(replaces)

dup_keep = indexes_df.groupby(indexes_df[keep_]).apply(
lambda x: _get_duplicates(x, drop_)
lambda x: _get_duplicates(x, drop_),
include_groups=False,
)
dup_drop = indexes_df.groupby(indexes_df[drop_]).apply(
lambda x: _get_duplicates(x, keep_)
lambda x: _get_duplicates(x, keep_),
include_groups=False,
)
duplicates = pd.concat([dup_keep, dup_drop])

Expand Down

0 comments on commit 15b1cee

Please sign in to comment.