Skip to content

Commit

Permalink
flatten list
Browse files Browse the repository at this point in the history
  • Loading branch information
ludwiglierhammer committed Oct 17, 2024
1 parent c535165 commit 85f019f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions cdm_reader_mapper/cdm_mapper/duplicates.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,11 @@ def _add_dups(row):
if idx not in dups.index:
return row

dup_idx = dups.loc[idx].to_list()[0]
v_ = report_ids.iloc[dup_idx]
dup_idx = dups.loc[idx].values.flatten()
v_ = report_ids.iloc[dup_idx[0]]
v_ = sorted(v_.tolist())
row["duplicates"] = "{" + ",".join(v_) + "}"
return row

report_ids = df["report_id"]
return df.apply(lambda x: _add_dups(x), axis=1)

Expand Down Expand Up @@ -181,7 +180,6 @@ def get_duplicates(
for must in equal_musts:
cond = cond & (self.compared[must])
self.matches = self.compared[cond]
print(self.compared)
return self.matches

def flag_duplicates(
Expand Down

0 comments on commit 85f019f

Please sign in to comment.