diff --git a/changelog_entry.yaml b/changelog_entry.yaml index e69de29bb..1e5cb75bf 100644 --- a/changelog_entry.yaml +++ b/changelog_entry.yaml @@ -0,0 +1,4 @@ +- bump: patch + changes: + fixed: + - Fix TypeError in uprate_rent when region.values.astype(str) returns a pandas StringArray instead of numpy array. diff --git a/policyengine_uk/data/economic_assumptions.py b/policyengine_uk/data/economic_assumptions.py index cc252b542..9c5f7069a 100644 --- a/policyengine_uk/data/economic_assumptions.py +++ b/policyengine_uk/data/economic_assumptions.py @@ -161,8 +161,9 @@ def uprate_rent( pass elif year < 2025: # We have regional growth rates for private rent. + # Convert to numpy array for vectorial parameter lookup regional_growth_rate = growth.ons.private_rental_prices(year)[ - region.values.astype(str) + np.array(region.values.astype(str)) ] current_year.household["rent"] = np.where( is_private_rented,