Skip to content

Commit fab390e

Browse files
committed
Fix error in wealth_characteristic_instances - see HEA-572
Duplicate columns names in wealth_group_df were causing the pd.concat to add the Baseline Wealth Groups.
1 parent 16661c0 commit fab390e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pipelines/assets/baseline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ def get_wealth_group_dataframe(
8383
wealth_group_df = wealthgroupcategorylookup.do_lookup(
8484
wealth_group_df, "district", "wealth_group_category", update=True
8585
)
86+
# Remove the duplicate wealth_group_category_original column created by the second do_lookup(),
87+
# which otherwise causes problems when trying to merge dataframes, e.g. when building the wealth_group_df.
88+
wealth_group_df = wealth_group_df.loc[:, ~wealth_group_df.columns.duplicated()]
8689
except ValueError:
8790
pass
8891

0 commit comments

Comments
 (0)