Skip to content

Commit

Permalink
fix: remove multiple duplicates in choice sheets
Browse files Browse the repository at this point in the history
  • Loading branch information
Sujanadh committed Sep 26, 2024
1 parent 5cec645 commit 78cfea5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion osm_fieldwork/update_xlsform.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,15 @@ def merge_dataframes(mandatory_df: pd.DataFrame, user_question_df: pd.DataFrame,

# If processing the choices sheet, retain all duplicates
if "list_name" in user_question_df.columns:
return pd.concat(
merged_df = pd.concat(
[
mandatory_df,
user_question_df,
digitisation_df,
],
ignore_index=True,
)
return merged_df.drop_duplicates(subset=['list_name', NAME_COLUMN], ignore_index=True)

# Else we are processing the survey sheet, continue

Expand Down

0 comments on commit 78cfea5

Please sign in to comment.