Skip to content

Commit

Permalink
Merge pull request #303 from hotosm/fix/remove-duplicates-choices
Browse files Browse the repository at this point in the history
Remove multiple duplicates in choice sheets
  • Loading branch information
nrjadkry authored Sep 27, 2024
2 parents 5cec645 + 176791b commit 491c6e8
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 491c6e8

Please sign in to comment.